David,
You will get more responses on DB2-L, but I believe this is due to the
ability in DB2 V8 to have multiple CCSID's in a statement, so DB2 has gotten
stricter on casting data types.  I think 
SELECT CHAR(SUBSTR(GEODATA,85,4)) INTO :releaseDate ....

Will get you what you are looking for.

Wayne Driscoll
Product Developer
NOTE:  All opinions are strictly my own.




-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of David Logan
Sent: Friday, September 12, 2008 8:54 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: DB/2 application error

*sigh*  Gotta love DB/2. Does anyone know why my code works fine in DB/2 v7
and fails (with a -303) in DB/2 v8?
GEODATA in this table is a BLOB(140).

-------------------------------------------------------------------
  -303   A VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER
          position-number BECAUSE THE DATA TYPES ARE NOT COMPARABLE
-------------------------------------------------------------------

EXEC SQL BEGIN DECLARE SECTION;                                      
char releaseDateÝ4¨;                                                 
long int currdate;                                                   
EXEC SQL END DECLARE SECTION;                                        
EXEC SQL                                                             
  SELECT EFFDATE INTO :currdate FROM GEODATE                         
     WHERE PRODUCT='GEOSTAN';                                        
//===============================================
// The following statement works fine in DB/2 V7,
// but returns a -303 in DB/2 V8
//===============================================
EXEC SQL                                                             
  SELECT SUBSTR(GEODATA,85,4) INTO :releaseDate FROM CITYDIR         
     WHERE ROWNUM=1 AND EFFDATE=:currdate;                           

Thanks!

David Logan
Manager of Product Development, Pitney Bowes Business Insight
http://centrus.com
W: (720) 564-3056
C: (303) 818-8222

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to