I'm curious what your actual definition for the template is based on. I do
a lot of external datastructures as templates, and defining a datastructure
from that datastructure as the cursor target. The error you get in my
number one annoyance, but not from the method I use. Usually I get this
problem when I define a cursor datastructure subfield as being like an
externally described display file field, so I wonder if the same might be
true of an external file from the file specs. I seem to recall it getting
upset if I go too deep, like defining a field like a field like a field
type of thing.
From: David Gibbs <david@xxxxxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>
Date: 07/18/2016 12:54 PM
Subject: Re: Embedded SQL with fully free form code?
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>
On 7/18/2016 11:45 AM, dlclark@xxxxxxxxxxxxxxxx wrote:
The SQL precompiler is not as smart as the RPG compiler. The SQL
precompiler will reject definitions are are marked as constants and
won't find definitions that are in copy books if you use the COPY
directive. Use the INCLUDE directive, instead. It also can't handle
definitions that use more than one qualifier.
The copy book with the definitions are /include(d).
I tried making these changes ...
dcl-s wTypeName like(im_AttributeTypeName);
wTypeName = pTypeName;
exec sql
select ATID
into :typeId
from IMUATP
where UCASE(ATNAME) = UCASE(:wTypeName);
... but got the same error, except it complained about WTYPENAME;
If I define wTypeName as char (15), it compiles fine.
david
--
David Gibbs
midrange.com
* IBM Power Systems Champion
IBM i on Power Systems: For when you can't afford to be out of business!
I'm riding 50 miles in the Hawaii Tour de Cure to raise money for diabetes
research, education, awareness, and advocacy.
Make an investment in a diabetes free future by donation. Visit
http://main.diabetes.org/goto/aloha16 to make a tax deductible donation.
I may have diabetes, but diabetes doesn't have me!
--
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,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.