× 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.



I complain about the fact that the source position requirement changed.

On Wed, Feb 10, 2010 at 1:34 PM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>wrote:

I've never been a fan of having to have the SET Options be the first SQL
code to appear in the program in a top-down fashion.

SET OPTION is never executed but is the equivalent of the H-Specs for
embedded SQL.
Have you ever complained about H-Specs being in front of all other
specifications?

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
Im
Auftrag von Kurt Anderson
Gesendet: Wednesday, 10. February 2010 18:51
An: 'RPG programming on the IBM i / System i'
Betreff: RE: SQL: RNF5347E An assignment operator is expected with the EVAL
operation.

I figured the source member type was too easy a solution, but that was the
only I was duplicating the issue.

Glad you got it resolved.

I've never been a fan of having to have the SET Options be the first SQL
code to appear in the program in a top-down fashion.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of rob@xxxxxxxxx
Sent: Wednesday, February 10, 2010 11:41 AM
To: RPG programming on the IBM i / System i
Subject: Re: SQL: RNF5347E An assignment operator is expected with the EVAL
operation.

Source type was SQLRPGLE.

Problem was twofold.
1 - Added exec sql into main body which put it before set options which
resulted in error about not allowed.
2 - Having the not allowed confused precompiler (oh Gina!!!!!) to no end.
This caused the RNF5347 error over a perfectly fine sql statement.

Simple fix was to move the main body sql statement to the fetch cursor
subprocedure. Resolved both issues.


Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: rob@xxxxxxxxx
To: RPG programming on the IBM i/System i <rpg400-l@xxxxxxxxxxxx>
Date: 02/10/2010 12:05 PM
Subject: SQL: RNF5347E An assignment operator is expected with the
EVAL operation.
Sent by: rpg400-l-bounces@xxxxxxxxxxxx



exec sql update rob/a1sqlf set mykey=mykey*1
where current of C1;
Gets
RNF5347E An assignment operator is expected with the EVAL operation.

No tgtrls specified. Using CRTSQLRPGI.


Complete program follows:

H ActGrp(*CALLER)
H DftActGrp(*NO)

D OpenCursor PR n
D FetchCursor PR n
D CloseCursor PR n

D mykey s 5i 0
D Mychar s 5a

/free
*inlr=*on;
if not OpenCursor();
// perform error routine to alert the troops
// ...
Else;
Dow FetchCursor();
// putting the fetchcursor on the do loop allows the user of
// iter, and thus iter will not perform an infinite loop
// normal processing here...
exec sql update rob/a1sqlf set mykey=mykey*1
where current of C1;
EndDo;
CloseCursor();
EndIf;
return;
/end-free

P OpenCursor B
D OpenCursor PI like(ReturnVar)
D ReturnVar s n

/free
EXEC SQL
Set Option
Naming = *Sys,
Commit = *None,
UsrPrf = *User,
DynUsrPrf = *User,
Datfmt = *iso,
CloSqlCsr = *EndMod,
COMPILEOPT='DBGVIEW(*LIST)';

EXEC SQL
Declare C1 cursor for
Select mykey,
mydata
from rob/a1sqlf;

EXEC SQL
Open C1;

Select;
When SqlStt='00000';
return *on;
Other;
return *off;
EndSl;
/end-free
P OpenCursor E

/eject
P FetchCursor B
D FetchCursor PI like(ReturnVar)
D ReturnVar s n
/free
EXEC SQL
Fetch C1 into :mykey, :myChar;
Select;
When sqlstt='00000';
// row was received, normal
ReturnVar=*on;
When sqlstt='02000';
// same as %eof, sooner or later this is normal
ReturnVar=*off;
Other;
// alert the troops!
ReturnVar=*off;
EndSl;
return ReturnVar;
/end-free
P FetchCursor E

/eject
P CloseCursor B
D CloseCursor PI like(ReturnVar)
D ReturnVar s n
/free
EXEC SQL
Close C1;
Select;
When sqlstt='00000';
// cursor was closed, normal
ReturnVar=*on;
Other;
// alert the troops!
ReturnVar=*off;
EndSl;
return ReturnVar;
/end-free
P CloseCursor E

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com

--
This is the RPG programming on the IBM i / System i (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.


--
This is the RPG programming on the IBM i / System i (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.

--
This is the RPG programming on the IBM i / System i (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.


--
This is the RPG programming on the IBM i / System i (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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.