RE: temp tables and serial columns
Posted in 2007
Good.I have no problem with specifying all columns most of the time.BTW, "select x from foo order by 1 into temp t" works for me on 9.4 .Also, BTW, your methodology of specifying all columns in the temp is cool until the dba adds a column to the main table that is not nullable. Then your code is broken. No code review could have prevented that. Maybe you are such an great manager that you are protected from such things. :-)> From: jleffler@earthlink.net> Subject: Re: temp tables and serial columns> Date: Tue, 13 Mar 2007 05:20:27 +0000> To: informix-list@iiug.org> > Bill Hamilton wrote:> > But that does not answer the question: "Is there a practical use for a > > serial column in a temp table?"> > Perhaps there are times when you don't want to use a sequence generator > > and the serial could be useful?> > For a long time, there were no sequences in IDS - just SERIAL columns.> > Yes, I regard a SERIAL column in a temp table as occasionally useful.> > It would be more useful if you were permitted to include ORDER BY with > the SELECT statement that inserts data into the table - it would give > you a simple numeric key that orders the data.> > I note that an explicit CREATE TEMP TABLE allows you to specify the > types of the columns - and thereby avoid the SERIAL and replace it with > INTEGER; OTOH, it also requires you to specify all the columns, and > there were a number of solutions offered which required that.> > -- > Jonathan Leffler #include <disclaimer.h>> Email: jleffler@earthlink.net, jleffler@us.ibm.com> Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/> _______________________________________________> Informix-list mailing list> Informix-list@iiug.org> http://www.iiug.org/mailman/listinfo/informix-list