Thanks that worked as in running the sql file itself...
I've got this message:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL7032N SQL procedure "P_CREATETABLE" not created. Diagnostic file is
"P8120162.log". SQLSTATE=42904
-- LOG FILE P8120162.log FOR PROCEDURE DB2INST1.P_CREATETABLE
-- DB2_SQLROUTINE_PREPOPTS=VALIDATE RUN
-- PREP/BIND MESSAGES FOR
/home/db2inst1/sqllib/function/routine/sqlproc/DOPE_24/DB2INST1/tmp/P8120162
.sqc
LINE MESSAGES FOR P8120162.sqc
------ --------------------------------------------------------------------
SQL0060W The "C" precompiler is in progress.
SQL0091W Precompilation or binding was ended with "0"
errors and "0" warnings.
-- CONTENTS OF /home/db2inst1/sqllib/function/routine/sr_cpath
#!/bin/sh
PATH=$PATH:/usr/vacpp/bin
PATH=$PATH:/usr/ibmcxx/bin
PATH=$PATH:/usr/lpp/xlC/bin
export PATH
-- CONTENTS OF
/home/db2inst1/sqllib/function/routine/sqlproc/DOPE_24/DB2INST1/tmp/P8120162
.sh
SQLROUTINE_FILENAME=P8120162
export SQLROUTINE_FILENAME
export SQLROUTINE_ENTRY=pgsjmp
-- COMPILATION COMMAND:
xlC_r -I/home/db2inst1/sqllib/include P8120162.c -bE:P8120162.exp -e
pgsjmp -o P8120162 -L/home/db2inst1/sqllib/lib -ldb2
-- CONTENTS OF
/home/db2inst1/sqllib/function/routine/sqlproc/DOPE_24/DB2INST1/tmp/P8120162
.exp
pgsjmp
-- COMPILATION MESSAGES FOR
/home/db2inst1/sqllib/function/routine/sqlproc/DOPE_24/DB2INST1/tmp/P8120162
.c
sh: xlC_r: not found.
-- END OF LOG FILE (SQLCODE: -7032)
DB21007E End of file reached while reading the command.
C:\>
-----Original Message-----
From: Srivastava, Sanjay [mailto:Sanjay.[Email Address Removed]
Sent: 02 March 2004 17:51
To: 'Regis Biassala'
Subject: RE: run stored procedure ddl in DB2(urgent)
Try
connect to eng user db2inst1 using db2dba @
(@ is the delimiter you are using)
Cheers.
-----Original Message-----
From: Regis Biassala [mailto:Regis.[Email Address Removed]
Sent: 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.
**********************************************************************
*********************************************************************
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