Just a question, are those variables being used defined locally to that proc & globally to the program? If so the SQL precompiler will have a hissy fit...or at least it used to, maybe they fixed the precompiler but not RDi?
Thanks,
Tommy Holden
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Ken Killian
Sent: Friday, August 26, 2016 11:35 AM
To: Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries <wdsci-l@xxxxxxxxxxxx>
Subject: Re: [WDSCI-L] SQL0314 on Punch-card Freedom sql statement in Procedures
Buck,
I have no problem with the Select Statement, just no outline view in RDI 9.5.0.3.
I remove all punch-card Sequence numbers, and put "**free", and my code no longer compiles. Remove the **FREE and it compiles. I did not shift the code over.
The compiler shows errors on every single SQL statements in Procedures. It give the error "SQL0314: Position 52 Host variable XXXXXXXX not unique."
I guess the Truly free is not ready for Prime time yet...
Small subset: The "Exec SQL" is failing...
dcl-proc OwnRequest;
dcl-pi *n;
end-pi;
// Load Saved Master Screen Record
LoadRecord();
Select;
// Cannot Claim Ownership of Closed Request When Wkxfsts = 'CLOSED';
#Msterr = @WHT;
Msterr = 'Cannot claim ownership of a Closed Request';
// User doesn't have authority to take ownership:
When AuthLevel > 2;
#Msterr = @RED;
Msterr = 'You do not have authority to take ownership';
// If request is active and unowned, assign current user Other;
Chain(e) (WkxfReqID) Xfmr;
Select;
When Not %Error And %Found(Fulxfmt) And Xfownid = *Blank;
zNow = %Timestamp;
Xfownid = Stusr;
Xfownts = zNow;
Xfchgusr = Stusr;
Xfchgpgm = Stpgm;
Xfchgts = zNow;
Update Xfmr;
// insert a record into XFM Request Log table by current user
LogText = 'Took Ownership';
exec sql
INSERT into fulxfmlt
(xlReqID, xlText, xlEntTs, xlEntUsr, xlEntPgm)
values
(:XfreqID, :LogText, :Xfownts, :Xfownid, :Xfchgpgm);
SQL0314: Position 52 Host variable XFCHGPGM not unique.
SQL0314: Position 42 Host variable XFOWNID not unique.
SQL0314: Position 32 Host variable XFOWNTS not unique.
SQL0314: Position 12 Host variable XFREQID not unique.
-Ken Killian-
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Friday, August 26, 2016 10:51 AM
To: wdsci-l@xxxxxxxxxxxx
Subject: Re: [WDSCI-L] SQL0314 on Punch-card Freedom sql statement in Procedures
On 8/26/2016 9:16 AM, Ken Killian wrote:
Outline view does not work because of this Select Statement:
When %Error And DspfStatus = 1331;
When I copy/paste this statement into my RDi 9.5.0.3 I get no errors, no warning triangles, no problems. When I write enough code to make it compilable, it does:
1234567890123456789012345678901234567890
dcl-s dspfStatus int(10);
select;
When %Error And DspfStatus = 1331;
// something would go here
endsl;
It flags it with the yellow marker on the right hand side. The warning
icon says this error: "WHEN_Opcode" expected instead of this input.
The code compile fine in Punch-card-column-EIGHT restriction. But not
in "**free", a.k.a. Punch-Card-FREEDOM. <puzzled-Look>
I thought Punch-card-freedom is supposed to work!
The one statement you posted does work.
It sounds as if you block-shifted the code from column 8 to column 1.
Did any other changes occur at that time? If you shift it all back does the warning triangle go away? I'm wondering if there is another error elsewhere which is clouding the picture.
--
--buck
Visit wiki.midrange.com and register for an account. Edit a page that helps you, and because it's public, you'll help someone else, too!
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
As an Amazon Associate we earn from qualifying purchases.