> I did discuss this with Sanja (the original implentor of views) briefly
> while fixing a nearly-related bug, and he agrees that it would be nice
> to be able to get the original query out. We'll look at making this
> available via something like INFORMATION_SCHEMA, but I can't commit to
> when that might happen. The original query is stored in the .frm file
> for the view, so it is "just" a matter of exposing that.
>
> It would be interesting to know how other DBMS make this available. (A
> quick look at some Google results show that Oracle exposes it via
> INFORMATION_SCHEMA.ALL_VIEWS, but I haven't consulted our standards
> gurus or taken a look at other databases.)
Oracle esposes this via the INFORMATION_SCHEMA.ALL_VIEWS and
their system tables.
NexusDB does it via a blob column in #views
MS SQL Server holds it in SYSCOMMENTS
InterBase and Firebird in a blob in RDB$RELATIONS.VIEW_SOURCE
With regards,
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com