Just to be clear, the fix here was not to add "ext" to the declaration.
The fix was to remove "*all" from the "extname" definition.
This will work with SQL:
extname('ADMINMAS')
This will not work with SQL RPGLE as it does not understand any of the EXTNAME modifiers.
extname('tableName':*ALL)
The "ext" declaration has the only added impact of allowing the name of the data structure to be the name of the File.
Allowing you to possibly omit the extname definition.
From the ILE RPG Reference:
EXT
The EXT keyword is used in a free-form data structure definition to indicate that the data structure is
externally-described. If the EXTNAME keyword is not also specified, the name of the data structure is
used to locate the external file that provides the subfield definitions.
If the EXT keyword is specified, it must be the first keyword.
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Filip Drzewiecki
Sent: Thursday, August 30, 2018 12:43 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Long names and Data structures based on SQL Table problem
@Arco
Adding ext to declaration has helped!
You are great :)!
Thanks
śr., 29 sie 2018 o 23:33 Arco Simonse <arco400@xxxxxxxxx> napisał(a):
Hi Filip,
The following code compiles well on my system:
**FREE
dcl-ds myTable ext extname('ADMINMAS') qualified alias;
end-ds;
dcl-ds myTable_X likeds(myTable);
EXEC SQL
SELECT * INTO :Mytable_x
FROM Administration_Master
WHERE Administration_Id = 1;
return;
Make sure that your filename is in uppercase when you use quotes, and
you will need the keyword EXT preceding to the EXTNAME keyword.
Hope that helps.
Regards,
-Arco
As an Amazon Associate we earn from qualifying purchases.