Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQLTYPE in SQLDA = '16' with SQLSTATE 7002 and sqlcode -804

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
deepag02

New User


Joined: 23 Jul 2007
Posts: 20
Location: India

PostPosted: Wed May 04, 2011 12:50 pm    Post subject: SQLTYPE in SQLDA = '16' with SQLSTATE 7002 and sqlcode -804
Reply with quote

HI,

In one of my COBOL-DB2 programs, i am trying to run a dynamic multi row fetch cursor using SQLDA. But i am gettting -804 sqlcode.

PFB the sql queries.

EXEC SQL
PREPARE S1 FROM :WS-DSTRING
END-EXEC

SQLCODE AFTER PREPARE +000


EXEC SQL
DESCRIBE S1 INTO :SQLDA
END-EXEC

DESCRIBE SQLCODE +000

on displaying SQLTYPE in binary format:
WS-SQLTYPE = 10000
WS-SQLTYPE 20000

EXEC SQL
DECLARE CUSTCUR CURSOR
WITH ROWSET POSITIONING FOR S1
END-EXEC

DECLARE CURSOR SQLCODE +000

COMPUTE SQLDABC = 104
COMPUTE SQLN = 2

EXEC SQL
OPEN CUSTCUR
END-EXEC

EXEC SQL
FETCH NEXT ROWSET FROM CUSTCUR FOR 1 ROWS
USING DESCRIPTOR :SQLDA
END-EXEC

WS-SQLCODE -000804
WS-SQLSTATE07002

using diagnostics :
WS-MESSAGE-TEXTAN ERROR WAS FOUND IN THE APPLICATION PROGRAM INPUT PARAMETERS FOR THE SQL STATEMENT, REASON 16
which means
"Unrecognized output data type".

Please let me know if the SQLTYPE needs to be changed, from what i understand it should be obatined my means of DESCRIBE itself. And is SQLTYPE = 16 (decimal of 10000 binary) a valid value? since i dont see that code in the manuals.
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Wed May 04, 2011 2:45 pm    Post subject:
Reply with quote

I'm no dynamic SQL coding expert but shouldn't you :

Code:
move 'WITH ROWSET POSITIONING' to ws-attr
EXEC SQL PREPARE S1 ATTRIBUTES :ws-attr FROM :WS-DSTRING

or

declare your cursor before preparing ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am
No new posts -81 SQLCODE returned when Remote Stor... kameswaramanoj.Akella DB2 1 Wed Dec 03, 2014 5:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us