Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prerequesites for Select sysibm.systables

Status
Not open for further replies.

gtthannover

Programmer
Dec 17, 2003
2
DE
Hello,

I have to write an embedded SQL progam with selecting the SYSIBM.SYSTABLES table. I do the statements CONNECT, PREPARE, DESRIBE, OPEN CURSOR with SQLCODE = 0. But The statement FETCH returns SQLCODE -804. Doing the SELECT interactively returns the correct result. The connected user has sufficient privileges.

Are there any precompiler options which might solve my problem?

Thanks in advance
Gabi Eichler
 
Gabi,

you have posted the SQLCODE, but not the reason code. Do you have the reason code. According to my documentation the call parameter list or the SQLDA is invalid. A question which springs to mind is have you coded your own SQLDA or used the IBM supplied SQLDA?

Bit more below pasted from MVS/QuickRef. Hope it helps.

The following is the list of reason codes:

01 Open issued for non-cursor.

02 Close issued for non-cursor.

03 Prepare of EXECUTE IMMEDIATE.

04 Statement is not recognized.

05 No statement string present.

06 Bad SQLDA format in parameter list.

07 SQLDA length is invalid.

08 Unrecognized input data type.

09 Invalid length for input variable.

10 Invalid data length for output variable.

11 The value of SQLDABC is not consistent with the value of SQLD.

12 Invalid input data pointer.

13 Invalid output data pointer.

14 SQLN has too many items for SQLDABC.

15 Input RDI pointer is invalid.

16 Unrecognized output data type.

17 The value of the 7th byte of SQLDAID is not consistent with the
data types contained in the SQLDA. The SQLDA contains a LOB type
host variable, but the 7th byte of SQLDAID is not set to '2' or
greater to indicate that the extended SQLVARs have been allocated.

Cheers
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top