Hello Johann, I was curious so I read about 'SELECT INTO', I think it a artifact since the suggest to use CREATE TABLE AS now :
Compatibility The SQL standard uses SELECT INTO to represent selecting values into scalar variables of a host program, rather than creating a new table. This indeed is the usage found in ECPG (see Chapter 30<http://www.postgresql.org/docs/8.1/static/ecpg.html>) and PL/pgSQL (see Chapter 36<http://www.postgresql.org/docs/8.1/static/plpgsql.html>). The PostgreSQL usage of SELECT INTO to represent table creation is historical. It is best to use CREATE TABLE AS for this purpose in new code. Richard On Tue, Jun 12, 2012 at 9:52 AM, Johann Spies <[email protected]>wrote: > I don't know about other databases but in Postgresql one can do a ' SELECT > INTO ...' which is described in the documentation as > > *SELECT INTO creates a new table and fills it with data computed by a > query. The data is not returned to the client, as it is with a normal > SELECT. The new table's columns have the names and data types associated > with the output columns of the SELECT. > * > How can I use that in DAL as a model is necessary for a DAL query to act > on a table? > > I know I can use db.executesql on the newly created table, but I want to > get the result in to a selectable grid if possible. As I understand it > SQLFORM.grid needs a db.query or at least a table to act on. > > > Regards > Johann > -- > Because experiencing your loyal love is better than life itself, > my lips will praise you. (Psalm 63:3) > >

