×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Have you looked up the SQLSTATE?
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rzala/rzalaccl.htm
"01004 The value of a string was truncated when assigned to another string data type with a shorter length. +000, +445, +802, +20141"
I'd say double-check that the Db2 column definitions match the RPG fields.
HTH
-----Original Message-----
From: Greg Wilburn [mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx]
Sent: Friday, January 10, 2020 1:14 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: SQL Error 01004
I'm getting this error inside my RPG program... I'm selecting 4 fields from one file into 4 fields in my program (which are defined by reference to fields in another file). I think the error is related to the time fields... but they are both defined the same.
All 4 fields in the "select into" are being populated correctly. However, my Sql State is 01004. Any ideas what could cause this? I'm on v7r3.
Code snippet:
Ompckr char(8)
Omplin packed(5:0)
Ompitm packed(5:0)
Ombgtm time(*iso) - defined as "T" in the file
(ALL fields are defined by reference to fields in a Physical file)
Exec Sql
Declare rfcsr Cursor for
Select aauser, count (distinct bbprt#), sum(bbqty#), min(aatime)
From RFPCKRBB
Join RFPCKRAA on aabid#=bbbid#
Where... Etc..
Exec Sql Open rfcsr;
Dou noRows;
Exec Sql Fetch Next from rfcsr
Into :ompckr, :omplin, :ompitm, :ombgtm;
If SqlStt <> SqlOk;
noRows = *on;
iter;
Endif;
As an Amazon Associate we earn from qualifying purchases.