Db2 Error 42821
of the value to be assigned to the column, parameter, host variable or transition variable by the SQL statement is https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n408.html incompatible with the declared data type of the assignment target. Both must be: v Numeric v Character v Graphic v Dates or character v Times or character v Timestamps or http://www.sqlerror.de/db2_sql_error_-408_sqlstate_42821.html character v Row IDs v The same distinct types However, dates, times, or timestamps cannot be assigned to a character column that has a field procedure. Also note that character and graphic data types are compatible when using Unicode. This SQLCODE is issued for any statement that fails required assignment rule checking. System action: The statement cannot be executed. Programmer response: Examine the current definition <- BACK TO INDEX This is a free Service. I assume no warranty for misprints, and for the correctness and completeness of information and entries.
-408 IBM's flagship relational database management system Post a reply Previous topic • Next topic • 2 posts • Page 1 of 1 BIND Error -408 by Quasar » Tue Jul 12, 2011 9:37 am Hi friends - I am trying to promote a package, in Changeman. The package has a program with embedded SQL in it. This program executes a SQL Query to fetch data from a PAYMENT_TB DB2 Table. Here's the FETCH using the cursor -Fetch from PAYMENT_TB Using CursorSelect http://www.ibmmainframeforum.com/db2/topic6139.html allEXEC SQL FETCH PAYMENT-TRANS INTO :PAY-BENE-SERIAL-NBR ,:PAY-ROLE-CDE ,:PAY-PYMNT-CTR ,:PAY-GAC-NBR ,:PAY-EVENT-CDE ,:PAY-BRANCH-CDE ,:PAY-ACCOUNTING-TYP db2 error ,:PAY-FREQ-CDE ,:PAY-AX-CDE ,:PAY-AX-AMT ,:PAY-EFF-DTE ,:PAY-PAY-BC-POSTING-DTE ,:PAY-APRV-CD:NULL-IND ,:PAY-CTS-OPER-ID END-EXEC. After fetching the data, I just add +1 to the PYMNT_CTR, and insert the same row back into the table.Select allADD +1 TO PAY-PYMNT-CTRInsert a db2 error 42821 new row into the tableSelect allEXEC SQL INSERT INTO PAYMENT_TB VALUES (:PAY-BENE-SERIAL-NBR ,:PAY-ROLE-CDE ,:PAY-PYMNT-CTR ,:PAY-GAC-NBR ,:PAY-EVENT-CDE ,:PAY-BRANCH-CDE ,:PAY-ACCOUNTING-TYP ,:PAY-FREQ-CDE ,:PAY-AX-CDE ,:PAY-AX-AMT ,:PAY-PAY-BC-POSTING-DTE ,:PAY-APRV-CD:NULL-IND ,:PAY-CTS-OPER-ID) END-EXEC Now, during promotion of the package, Changeman performs a DB2 BIND, where I am getting a -408 SQLCODE.Select allDSNT233I -FDSN UNSUCCESSFUL BIND FOR PACKAGE = RISCTEST.T0828_P_CICS.F0828D16.(CTTS003838) DSN BIND PACKAGE (F0828_T_CICS) OWNER (F0828DBA) QUALIFIER DATE (BIND) ISOLATION (CS) ENABLE (*) CURRENTDATA (1) FLAG (I) SQLERROR (NOPACKAGE) EXPLAIN (DSNX200I -FDSN BIND SQL ERROR