Mike and Norbert.

Thanks for the help. have to re-work the source a bit, but am past the pre-compiler error.

   --Dave
----- Original Message ----- From: "Norbert Friemel" <[email protected]>
Newsgroups: bit.listserv.ibm-main
To: <[email protected]>
Sent: Friday, August 05, 2011 6:23 PM
Subject: Re: SQL help please


On Fri, 5 Aug 2011 16:58:00 -0500, Dave Day wrote:


DSNH312I E DSNHSMUD LINE 863 COL 31 UNDEFINED OR UNUSABLE HOST VARIABLE "GTPLNAME" DECLARE C1 CURSOR FOR SELECT BNAME,BCREATOR,BTYPE FROM SYSIBM.SYSPLANDEP WHERE DNAME = : GTPLNAME


Column NAME in SYSPLAN is defined the same as DNAME in SYSPLANDEP. Varchar 24. GTPLNAME in my source is defined as a DS H,CL24. Anyone have an idea. I appreciate the help. Thanks in advance.


Did you declare "GTPLNAME" *before* using it in the DECLARE CURSOR statement? With the TWOPASS precompiler option (the default for ASM) you can declare host variables after using them in SQL statements, but you still need to declare them before use in a "DECLARE CURSOR". The first statement is a "SELECT", the second is a "DECLARE CURSOR".

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2z9.doc.apsg/src/tpc/db2z_declarehostvariableassembler.htm

Norbert Friemel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to