View previous topic :: View next topic
|
Author |
Message |
ahmeds
New User
Joined: 04 May 2009 Posts: 5 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
there is no reason code getting displayed. |
seems that DB2 has different ideas
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 |
|
|
ahmeds
New User
Joined: 04 May 2009 Posts: 5 Location: chennai
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
ahmeds
New User
Joined: 04 May 2009 Posts: 5 Location: chennai
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
ahmeds
New User
Joined: 04 May 2009 Posts: 5 Location: chennai
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
07002 The call parameter list or control block is invalid. |
|
Back to top |
|
|
ahmeds
New User
Joined: 04 May 2009 Posts: 5 Location: chennai
|
|
|
|
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 .. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
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 |
www-01.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/com.ibm.db2z11.doc.codes/src/tpc/n804.dita |
|
Back to top |
|
|
|