Harish, Consider doing things outside sqlite. Definitely you should be using C API or php API or some other for making query to DB. Why don't you think of doing things outside sqlite VENKAT Bug the Bugs
________________________________ From: Harish CS <cshar...@gmail.com> To: sqlite-users@sqlite.org Sent: Mon, February 7, 2011 6:08:29 PM Subject: Re: [sqlite] Trigger to filter out characters Simon, Thanks. Trim(X,Y) is useful but I need to remove anything other than '0' - ' '9' and a few more characters. 180+ characters need to be removed (filtered out). So I will need to call Trim() so many times. Since we cannot write loops I wonder how I can call it many times. -Harish Simon Slavin-3 wrote: > > > On 7 Feb 2011, at 8:38am, Harish CS wrote: > >> Table T has two varchar columns A and B. UI allows entering values into >> column A only. >> On insert/update of records, I need to take out the value of A, filter >> out >> anything other than '0' to '9', '*', '#', '+' 'p', 'w' characters and >> copy >> it to column B. Is it possible to write a trigger to achieve this? If yes >> please give me a sample. (Also, if column B is in another table, is it >> possible?) > > I don't think you need a trigger. You might find the 'trim(X,Y)' function > from > > http://www.sqlite.org/lang_corefunc.html > > helpful. You'll have to list all characters you /don't/ want left in the > string. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://old.nabble.com/Trigger-to-filter-out-characters-tp30861522p30863194.html Sent from the SQLite mailing list archive at Nabble.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