On Tue, Dec 30, 2014 at 9:40 AM, Jonathan Leslie <j...@jonathanleslie.com> wrote:
> PRAGMA foreign_key_list(table-name) > I don't know the table-name, how do I get a list of table names in the > database? > > select * from sqlite_master > > From: Simon Slavin <slav...@bigfraud.org> > To: Jonathan Leslie <j...@jonathanleslie.com>; General Discussion of > SQLite Database <sqlite-users@sqlite.org> > Sent: Tuesday, December 30, 2014 11:14 AM > Subject: Re: [sqlite] SQL newbie, how to implement a delete correctly. > > > On 30 Dec 2014, at 3:53pm, Jonathan Leslie <j...@jonathanleslie.com> wrote: > > > Sorry, I wasn't clear. what if there are other child tables, say > child02- childxx, and you don't know the names of the table, you want to > search the entire database? > > SQLite has no command which will help it specifically find all the child > rows of a row. You will have to use a set of SELECT commands like the one > Hick posted. > > It would be possible to write some clever code which came up with this > list. You would want to start off executing > > PRAGMA foreign_key_list(table-name) > > and looking at the results you get back from it. From those you could > generate SELECT statements which found the child rows. > > Simon. > > > _______________________________________________ > 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 > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users