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
 

 

SQLCODE -804

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

New User


Joined: 04 May 2009
Posts: 5
Location: chennai

PostPosted: Thu Jan 26, 2012 3:24 pm    Post subject: SQLCODE -804
Reply with quote

I am getting sqlcode -804 error for select statement.

I am using static sql and there is no reason code getting displayed.

can anyone pls help in resolving this 804 issue??
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Jan 26, 2012 3:26 pm    Post subject: Reply to: SQLCODE -804
Reply with quote

Quote:
there is no reason code getting displayed.

seems that DB2 has different ideas icon_cool.gif

according to the manuals
Quote:
-804
AN ERROR WAS FOUND IN THE APPLICATION PROGRAM INPUT PARAMETERS FOR THE SQL STATEMENT, REASON reason

the reason is bad code
Back to top
View user's profile Send private message
ahmeds

New User


Joined: 04 May 2009
Posts: 5
Location: chennai

PostPosted: Thu Jan 26, 2012 3:28 pm    Post subject: Re: Reply to: SQLCODE -804
Reply with quote

enrico-sorichetti wrote:
Quote:
there is no reason code getting displayed.

seems that DB2 has different ideas --)

any idea how to display reason code..
DSNTIAR pgm is not giving any reason code..
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jan 26, 2012 3:30 pm    Post subject:
Reply with quote

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.codes%2Fsrc%2Ftpc%2Fdb2z_sqlcodes.htm
Back to top
View user's profile Send private message
ahmeds

New User


Joined: 04 May 2009
Posts: 5
Location: chennai

PostPosted: Thu Jan 26, 2012 3:34 pm    Post subject:
Reply with quote

PeterHolland wrote:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.codes%2Fsrc%2Ftpc%2Fdb2z_sqlcodes.htm

this link shows that there is an error in sqlda... but am not using sqlda in my program...
and the sql query is working fine for sometime and not working sometime..
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jan 26, 2012 3:39 pm    Post subject:
Reply with quote

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.apsg%2Fsrc%2Ftpc%2Fdb2z_displaysqlcadsntiar.htm
Back to top
View user's profile Send private message
ahmeds

New User


Joined: 04 May 2009
Posts: 5
Location: chennai

PostPosted: Thu Jan 26, 2012 3:41 pm    Post subject:
Reply with quote

PeterHolland wrote:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.apsg%2Fsrc%2Ftpc%2Fdb2z_displaysqlcadsntiar.htm


Code:
DSNT408I SQLCODE = -804, ERROR:  AN ERROR WAS FOUND IN THE APPLICATION     
         PROGRAM INPUT PARAMETERS FOR THE SQL STATEMENT                     
DSNT418I SQLSTATE   = 07002 SQLSTATE RETURN CODE                           
DSNT415I SQLERRP    = DSNXECP SQL PROCEDURE DETECTING ERROR                 
DSNT416I SQLERRD    = 204  0  0  1  1077952576  0 SQL DIAGNOSTIC           
         INFORMATION                                                       
DSNT416I SQLERRD    = X'FFFFFF34'  X'00000000'  X'00000000'                 
         X'FFFFFFFF'  X'40404040'  X'00000000' SQL DIAGNOSTIC               
         INFORMATION                                                       
                                                                           

i tried calling dsntiar also... it is giving the above information...but there is no reason code. :cry:
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jan 26, 2012 3:47 pm    Post subject:
Reply with quote

07002 The call parameter list or control block is invalid.
Back to top
View user's profile Send private message
ahmeds

New User


Joined: 04 May 2009
Posts: 5
Location: chennai

PostPosted: Thu Jan 26, 2012 3:50 pm    Post subject:
Reply with quote

PeterHolland wrote:
07002 The call parameter list or control block is invalid.

but it is working fine for somerecords ... and not working for somerecords..
and am sure that it is data issue.. because i changed the position of records and ran the job...the job failed with same sqlcode -804 for different record .. icon_surprised.gif
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu Jan 26, 2012 6:49 pm    Post subject:
Reply with quote

What version of DB2 are you using? According to the version 9 manual, there should be a reason code along with the message.

Often this problem is due to an invalid host variable. I have seen this error when the length of an variable length host variable was set incorrect.

The V9 manual lists many possibilities. FWIW, I have bolded the ones that in my experience, are the most likely culprits in a static SQL program:

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.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jan 27, 2012 1:06 pm    Post subject:
Reply with quote

Quote:
-804
AN ERROR WAS FOUND IN THE APPLICATION PROGRAM INPUT PARAMETERS FOR THE SQL STATEMENT, REASON reason
Explanation

The call parameter list or the SQLDA is invalid.
The call parameter list, which is created by the precompiler, might be invalid if the application programmer has modified the output of the precompiler, used a variable name beginning with 'SQL' in the application program, or overwritten the call parameter list in some other way.
The SQLDA, which is created by the application program, has an invalid data type or data length.
The value of SQLDABC is not consistent with the value of SQLD.
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.
18
An ARRAY SQLTYPE was specified in an SQLDA.
19
Invalid program name.
System action

The statement cannot be processed.

System programmer response

Examine the application program for any of the errors noted under the explanation above. In general, the application programmer should not attempt to modify the output of the precompiler.

SQLSTATE

07002


https://www-01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.codes/src/tpc/n804.dita
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