Can someone tell me what is wrong with this SQL statement...need some help 
please.  I'm trying to access catalog table SYSIBM.SYSPLANDEP and cannot get 
past the pre-compiler.  I use the same host variable to access SYSIBM.SYSPLAN 
earlier in the code, and the pre-compiler doesn't gripe.

1st peice of SQL---no gripe

 EXEC  SQL  SELECT CREATOR, ISOLATION, RELEASE, EXPLAN,        +
       BOUNDBY, QUALIFIER, GROUP_MEMBER, BOUNDTS, REOPTVAR,    +
       REMARKS                                                 +
       INTO :GTPLOWNR, :GTPLISOL, :GTPLRELS, :GTPLEXPL,        +
       :GTPLBNBY, :GTPLAUAL, :GTPLGRUP, :GTPLTIME, :GTPLREOP,  +
       :GTPLCMNT                                               +
       FROM SYSIBM.SYSPLAN                                     +
       WHERE NAME = :GTPLNAME                                   

2nd piece of SQL---with pre-compiler error msg.

EXEC  SQL DECLARE C1 CURSOR FOR                               +
      SELECT BNAME, BCREATOR, BTYPE                           +
      FROM SYSIBM.SYSPLANDEP                                  +
      WHERE DNAME = :GTPLNAME                                  



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.

    --Dave Day


----------------------------------------------------------------------
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