5 pts.
 What does this mean when SQLCOD = -206? I need to write 2 sets embedded SQL statement in my program.
what does this mean when SQLCOD = -206. I need to write 2 sets embedded SQL statement in my program. first one is one and I was able to fetch data but the 2nd one has error just right after I declare cursor. Here are the statements EVAL SQLSTMT2 = SELECT_H_2 + WHERE_H_2; + AND_H_A; EXEC SQL PREPARE S2 FROM :SQLSTMT2; EXEC SQL DECLARE S2CURSOR CURSOR2 FOR S2; IF SQLCOD < 0; DUMP; LEAVESR; ENDIF;

Software/Hardware used:
System I
ASKED: August 19, 2010  7:06 PM
UPDATED: August 19, 2010  10:55 PM

Answer Wiki:
First, you should get away from using SQLCOD (SQLCODEs) and use SQLSTATE instead. SQLSTATE is more standard and is better supported now and into the future. A quick explanation of a SQLCOD can be found by displaying the associated message identifier. For SQLCOD = -206, the message ID is SQL0206. SQL message IDs should be found in message file QSYS/QSQLMSG. Therefore:<pre> DSPMSGD SQL0206 MSGF( QSQLMSG )</pre> The basic text then is "Column &1 not in specified tables." Without seeing the value you have in SQLSTMT2, along with the column list for whatever table(s) or view(s) is referenced in SQLSTMT2, there's not much we can add. I'd suggest that this:<pre> EVAL SQLSTMT2 = SELECT_H_2 + WHERE_H_2; + AND_H_A;</pre> ...seems a little odd, though. Tom
Last Wiki Answer Submitted:  August 19, 2010  9:45 pm  by  TomLiotta   110,105 pts.
All Answer Wiki Contributors:  TomLiotta   110,105 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Since your program did a dump can you tell use what as in those 4 varibles..we might have a change at helping.
Phil

 44,630 pts.