> Did you see the code in the link I provided?  It's a function that can be 
> added to SQL.

Note, it's not SQL. SQL doesn't support "adding functions". SQL is all
about SELECT/INSERT/UPDATE/DELETE + DDL commands (like CREATE TABLE).
That's it. So the link you provided is a function that can be added to
T-SQL which is an internal programming language of MS SQL Server.

SQLite doesn't have its own internal programming language, so it
doesn't support writing stored procedures and functions like the
example in the link. And although SQLite allows to add functions
written in C those functions can't return such datatype as "table". So
behavior you want is impossible to reproduce with SQLite and you have
to implement it in your programming language.
And just to prevent speculations about this: lacking of own
programming language is not an issue for SQLite. Having such language
won't have any benefit because SQLite works differently than any
client-server DBMS. Doing what you want in your programming language
will always work faster and is more convenient to implement.


Pavel


On Wed, Aug 24, 2011 at 10:47 PM, Gregory Moore
<thewatchful...@gmail.com> wrote:
> I don't know know whether it's a SQLite "issue" or not.  Did you see the code 
> in the link I provided?  It's a function that can be added to SQL. I just 
> need to find out whether it can be added to SQLite and if so, then how to add 
> it.  I'd like to know before I try it whether I would run the risk of messing 
> up my SQLite "installation."   Thanks!
>
> On Aug 24, 2011, at 9:35 PM, J.M. Royalty wrote:
>
>> On 8/24/2011 9:05 PM, Gregory Moore wrote:
>>> I'm thinking it's parameters would be the name of a column and a character 
>>> to designate where the string wold be separated.  It would return multiple 
>>> rows and each row would contain a piece of the string.
>>>
>>> In other word, take a table like this:
>>>
>>> c1 c2
>>> -------
>>> 1  a; b; c
>>>
>>> run a statement like this:
>>>
>>> select c1, split(c2, ';')from t1;
>>>
>>> and get this:
>>>
>>> c1 c2
>>> -------
>>> 1   a
>>> 1   b
>>> 1   c
>>>
>>> Maybe SQLite can do it or not, i don't know.  I've searched using Google 
>>> and found code for a few different implementations but they are for other 
>>> dialects of SQL.  Here's a link to one such function i found:
>>>
>>> http://www.logiclabz.com/sql-server/split-function-in-sql-server-to-break-comma-separated-strings-into-table.aspx
>>>
>>> Would that work with SQLite?
>>>
>>> On Aug 24, 2011, at 8:40 PM, Igor Tandetnik wrote:
>>>
>>>> On 8/24/2011 9:36 PM, Gregory Moore wrote:
>>>>> Thanks for answering!  Can this not be added as a function?
>>>> What parameters would such a function take, and more interestingly, what
>>>> would its return value be?
>>>> --
>>>> Igor Tandetnik
>>>>
>>>>
>>>> Gregory Moore
>>>> thewatchful...@gmail.com
>>>>
>> lurker here, but felt compelled, and my apologies in advance, but ....
>>
>> Isn't this more a function of whatever language you are using and not a
>> SQLite issue?
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> Gregory Moore
> thewatchful...@gmail.com
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to