Serge Rielau wrote:[color=blue]
> JohnO wrote:[color=green]
> > Serge Rielau wrote:[color=darkred]
> >> JohnO wrote:
> >>> Serge, why the two step insert? Why not just
> >>> CREATE TABLE T AS (SELECT * FROM TABLE(FOO(1, 1)) AS F) WITH DATA;
> >> I for the life of it can't find WITH DATA in the syntax diagram...
> >> Seriously - what's so bad about separating declaration of the table from
> >> filling it? If DB2 were to support WITH DATA it would save you nothing
> >> but parsing the SELECT twice. A teeny, tiny bit of CPU cost, since the
> >> CREATE TABLE will NOT execute the SELECT. It merely derives the data types.
> >>
> >> Cheers
> >> Serge
> >>
> >>
> >> --
> >> Serge Rielau
> >> DB2 Solutions Development
> >> IBM Toronto Lab
> >>
> >> IOD Conference
> >>
http://www.ibm.com/software/data/ond...ness/conf2006/[/color]
> >
> > Hi Serge, can't tell if you are just kidding me but... "WITH DATA" is
> > in the Syntax diagram for CREATE TABLE in my SQL manual "DB2 UDB for
> > iSeries SQL Reference V5R3" on page 568.
> >
> > I *really* like succinct code, and *hate* seeing 2 lines of code when
> > one will do. For a start, it is less code to maintain; if the table
> > name is changed, you only have to change it in one place. If the
> > parameters change, they only change in one place etc. Most of all, it
> > is just more elegant - to my eye anyway.[/color]
> I agree on elegance. Chances that the OP is using DB2 for iSeries are
> rather slim though. I didn't know that iSeries has stepped up to WITH
> DATA. Good to know :-)
>
> Cheers
> Serge[/color]
Indeed. I just happened to notice it appeared after we upgraded to V5R3!