BINGO!
I was making this harder than it was... THANKS!
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Therrien, Paul via RPG400-L
Sent: Friday, January 10, 2020 2:28 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: Therrien, Paul <ptherrien@xxxxxxxxxxx>
Subject: RE: SQL Error 01004
01004 The value of a string was truncated when assigned to another string data type with a shorter length. +000, +445, +802, +2014
How big is AAUSER? longer than 8a?
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Greg Wilburn
Sent: Friday, January 10, 2020 2: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;
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.