I have an SQL table with long names. Based on below article I've tried
to declare Data Structure based on this table so I can select all
columns to my Data stucture in service program. Problem is that
I always get Error "XXX is not defined or no usable" during srvpgm
compilation where XXX is the name of DS which is based on another DS
with extname and alias. Even if I use main DS(the one with extname)
error is the same. I thought that adding alias will fix problem with
long names. When I declared the same DS but I've specified all fields
explicitly, compilation was successful.
Dcl-Ds myTable extname('tableName':*ALL) qualified alias;
Dcl-ds myTable_X likeds myTable);
select * into : myTable_X from tableName where ID= :UserId;
This on is failing. SQL always return one row of data. After I change
DS and declare all fields (70...) myself, it starts to compile. I
really don't know why. Any idea? Maybe this can't be done with srvpgm?
I handle nulls in table by using ALWNULL(*INPUTONLY).
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD