I agree with the other poster. You can just use any string manipluation routines you like to assemble the SQL into a string and then execute it. Take care with literals, eg where name = 'fred' might have to become where name = ''fred'' in Delphi (thats two single quotes at each end).
If it's any help, two brilliant tools that I use are SQLinForm (http://www.sqlinform.com) and SQLite Expert (http://www.sqliteexpert.com/). SQLinForm lets me take some sql that I know works and with one click format it to generate a string in loads of languages. So for example the sql.. select name from people where age = 30; becomes SQL := '' +'SELECT name ' +'FROM people ' +'WHERE age = 30;'; and you can then copy/paste it into your editor and tweak it to accept variables at runtime instead. SqliteExpert is simply the best database management system for SQLite that I have come across (and I've tried a few!) I can try out my sql, make tables, see data and do all the manipulation I like. Two tools I wouldn't be without when developing. -- View this message in context: http://sqlite.1065341.n5.nabble.com/Dynamically-generate-SQL-statements-for-SQLite-tp71240p71243.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