Interesting, Oracle won't let you do this either, in this fashion. You'll need to look through the supplied procedures/functions that DB2 provides as there is probably a built in that allows for DDL.
Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA
-----Original Message-----
From: Regis Biassala [mailto:Regis.[Email Address Removed] Tuesday, March 02, 2004 12:43 PM
To: [Email Address Removed] run stored procedure ddl in DB2(urgent)
Yo Gurus,
I don't understand why this stored procedure cannot be created as simple as
it gets:
File name is: 2.sql
#### cut here ####
connect to eng user db2inst1 using db2dba;
CREATE PROCEDURE p_createtable(IN p_tablename VARCHAR(18))
SPECIFIC creates_tables
LANGUAGE SQL
BEGIN
create table test1(id integer);
END
@
connect reset;
##### cut here ###
I am running it as follow:
C:\> db2 -[Email Address Removed] -f 2.sql
Error I am getting:
SQL0104N An unexpected token "CREATE" was found following "<identifier>".
Expected tokens may include: "NEW". SQLSTATE=42601
DB21007E End of file reached while reading the command.
Can someone tell why it is failing ?
Thanks,
Regis
*********************************************************************
This electronic transmission is strictly confidential and intended solely
for the addressee. It may contain information which is covered by legal,
professional or other privilege. If you are not the intended addressee,
you must not disclose, copy or take any action in reliance of this
transmission. If you have received this transmission in error,
please notify the sender as soon as possible.
This footnote also confirms that this message has been swept
for computer viruses.
**********************************************************************
DB2 & UDB email list listserv db2-l LazyDBA home page