Yes.
Typically all none DML (SELECT, UPDATE, INSERT, SET) can be done using
dynamic SQL.
For convenience DB2 for LUW supports also CREATE/DROP of Tables and Indices
directly.
The generic way to do DDL and DCL is:
CREATE PROCEDURE P()
BEGIN
DECLARE txt VARCHAR(32000);
SET txt = 'CREATE TABLE T1(C1 INT)';
EXECUTE IMMEDIATE txt;
END
Cheers
Serge
"Kaushal Anand " <db2udbdba-ezmlmshield-x19660557.[Email address protected]
wrote on 03/27/2006 03:15:14 AM:
>
> hello all,
>
> i seem to be asking a lotta questions. i'm quite new to this field.
> i've joined a month back and i'm still undergoing training. i'm sure
> in a few months time i'll be able to answer your queries as well.
> thanks for you prompt replies, all of you.
>
> well my question is - is it possible to create a table/index at run-
> time (in a procedure)???
>
>
> ______________________________
> Anand Kaushal
> Software Engineer - Database
>
> Lionbridge
> 5th Floor, Spectra Building,
> Hiranandani Business Park,
> Powai, Mumbai - 400 076
> +91-22-55567000x7079 (office)
> +91-9819210090 (mobile)
> www.lionbridge.com
>
>
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
DB2 & UDB email list listserv db2-l LazyDBA home page