Hello,
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;
End-Ds;
Dcl-ds myTable_X likeds myTable);
Exec SQL
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).
Best Regards
Filip
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;
End-Ds;
Dcl-ds myTable_X likeds myTable);
Exec SQL
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).
Best Regards
Filip
Comment