Re: [sqlite] String manipulation with pure sqlite3?

2007-11-20 Thread Ken
I think you just need to implement an INSTR(x,y,z) where X is the input string. Y is the search string, and z is the search starting location. Typically negative numbers indicate the end of the string to search backwards. So Substr(t1.col, 0, instr(t1.col, '.', -1) ) || '(' t2.col ||')'

Re: [sqlite] String manipulation with pure sqlite3?

2007-11-20 Thread Alexander Skwar
Daniel Önnerby schrieb: This should be a simple task for any programming language to do once the results has been retrieved. Yes, of course. But it would be nice, if that could be done on SQL level. With the current expressions in SQLite I believe there is no way to do this unless you extend

Re: [sqlite] String manipulation with pure sqlite3?

2007-11-20 Thread Daniel Önnerby
This should be a simple task for any programming language to do once the results has been retrieved. With the current expressions in SQLite I believe there is no way to do this unless you extend SQLite with your own "string_find_last" or "replace_last" function. Alexander Skwar wrote: Hello.

[sqlite] String manipulation with pure sqlite3?

2007-11-20 Thread Alexander Skwar
Hello. Suppose I've got tables like this: sqlite> .schema t1 CREATE TABLE t1 (id integer primary key not null, name); sqlite> .schema t2 CREATE TABLE t2 (t1id integer, txt STRING NOT NULL); Filled with: sqlite> select * from t1; 1|foo.bar.boing