View Single Post
  #1 (permalink)  
Old 01-05-09, 17:46
KevinYC KevinYC is offline
Registered User
 
Join Date: Aug 2008
Posts: 42
DB2 Plan Question

Hello,

I am creating a new cobol program which accesses a DB2 table. I am using an old plan which is no longer used by any program. Is this OK? Are plans table-specific? Does each plan include unique access information for specific tables only?

In other words, do i need to find a plan that includes accesses infomation for the table that my program needs? I am asking because i get compile errors regarding the fetch statement. I am wondering if the table used in the program is not included in the plan??


EXEC SQL
FETCH CUR_PMTYR
INTO : DCLADVTB950.YRGIVING
END-EXEC.


Errors:
UNDEFINED OR UNUSABLE HOST VARIABLE "DCLADVTB950".

UNDEFINED OR UNUSABLE HOST VARIABLE "YRGIVING".

THE OPEN STATEMENT FOR CURSOR 'CUR_PMTYR' IS INVALID BECAUSE THE CURSOR WAS DEFINED BY AN ALLOCATE CURSOR STATEMENT.

Thanks much in advance!!
Reply With Quote