×
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.
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.
http://www.rpgpgm.com/2018/05/how-to-sql-tables-long-names-in-rpg.html
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
As an Amazon Associate we earn from qualifying purchases.