On Wed, Mar 20, 2013 at 07:00:29PM +0100, Stephan Beal scratched on the wall:
> On Wed, Mar 20, 2013 at 6:53 PM, Jay A. Kreibich <j...@kreibi.ch> wrote:
> 
> >   That way I can use WHERE on them.  In the past I've used virtual
> >   tables to wrap the PRAGMAs into something that looked and acted more
> >   like a real table.
> 
> can you give us an example of how that is done?


  Chapter 10:  http://shop.oreilly.com/product/9780596521196.do

  Also see the "Download Example Code" link on that page.
  ".../ch10/dblist.c" shows how to wrap "PRAGMA database_list" in a VT.
  It should be pretty easy to modify this so that it would work with
  any PRAGMA.

  There is nothing fancy going on here... the virtual table still calls
  the PRAGMA and sifts through the results.  It just gets abstracted a bit.


  Somewhere I have a VT that will build a table out of any SQL
  statement.  That sounds kind of dumb, since that's either redundant,
  or something you could do with a VIEW, but it can also be used for
  any PRAGMA.  No idea where that code is off the top of my head
  however.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to