DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 14th, 2006, 09:20 AM
OS2dude OS2dude is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 3 OS2dude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 4 sec
Reputation Power: 0
RPG Embedded SQL - SQLSTT 22018

I have a DB2 file that is made up of alpha and numeric (ZONED) fields. If I STRSQL and select, everything is fine. If I embed same select and FETCH INTO an external DS, I get the SQLSTATE 22018. (Invalid Data)

How do I determine which field is causing the problem? Why doesn't the interactive SQL give me an error?

Interactive SQL Code:
Original - Interactive SQL Code
    SELECT * FROM MYTABLE WHERE MYFIELD = 4 SELECT statement run complete.       


RPGLE Program Code:
Original - RPGLE Program Code
    D MYEXTDS       E DS                  EXTNAME(MYTABLE) C*EXEC SQL                  C* DECLARE MYCURSOR CURSOR FOR C*   SELECT *                C*     FROM MYTABLE            C*     WHERE MYFIELD = 0004 C*END-EXEC                                              C*EXEC SQL                  C* OPEN MYCURSOR              C*END-EXEC          C*EXEC SQL        C* FETCH NEXT      C*   FROM MYCURSOR  C*   INTO :MYEXTDS C*END-EXEC               

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > RPG Embedded SQL - SQLSTT 22018


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway