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



What happens if you embedd the field and accociated indicatior into
parenthesis?

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!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> On Behalf Of
dlclark@xxxxxxxxxxxxxxxx
Sent: Mittwoch, 9. Mai 2018 21:07
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: SQL Extended Indicators

"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 05/09/2018
02:24:52 PM:
I've used SQL Extended Indicators with RPG and dynamic SQL.
But
I
wonder if SQL Extended Indicators can also be used with static SQL?
Also,
are Extended Indicators honored in an internal (i.e., LANGUAGE SQL)
stored
procedure?


I ask, because I can't get them to be accepted in one of my stored
procedures and I am wondering what I am doing wrong. I have four columns
that sometimes I want to update and sometimes I don't. So I start with
this:

Declare BgnYrCst_Ind SmallInt Default 0; Declare EndYrCst_Ind SmallInt
Default 0; Declare EndQtyHnd_Ind SmallInt Default 0; Declare EndQtyHld_Ind
SmallInt Default 0; Declare IGNORE_VALUE SmallInt Default -7;

If BgnYrCst is NULL Then
Set BgnYrCst_Ind = IGNORE_VALUE;
End If;
If EndYrCst is NULL Then
Set EndYrCst_Ind = IGNORE_VALUE;
End If;
If EndQtyHnd is NULL Then
Set EndQtyHnd_Ind = IGNORE_VALUE;
End If;
If EndQtyHld is NULL Then
Set EndQtyHld_Ind = IGNORE_VALUE;
End If;


Then I tried these two formats for static SQL:

Update QTEMP/IMLFADJA
Set BgnYrCst = BgnYrCst BgnYrCst_Ind
, EndYrCst = EndYrCst EndYrCst_Ind
, EndQtyHnd = EndQtyHnd EndQtyHnd_Ind
, EndQtyHld = EndQtyHld EndQtyHld_Ind
, ChgByUsr = SESSION_USER
, ChgByPgm = 'IMLFADJSP'
Where ImLfAdjTid = AdjTid;
SQL0104 Position 32 Token BGNYRCST_IND was not valid.

Update QTEMP/IMLFADJA
Set BgnYrCst = BgnYrCst INDICATOR BgnYrCst_Ind
, EndYrCst = EndYrCst INDICATOR EndYrCst_Ind
, EndQtyHnd = EndQtyHnd INDICATOR EndQtyHnd_Ind
, EndQtyHld = EndQtyHld INDICATOR EndQtyHld_Ind
, ChgByUsr = SESSION_USER
, ChgByPgm = 'IMLFADJSP'
Where ImLfAdjTid = AdjTid;
SQL0199 Position 32 Keyword INDICATOR not expected.


And I tried these two formats for dynamic SQL (the first one works
in RPG):

Execute IMLFADJSP_STMT Using BgnYrCst BgnYrCst_Ind
, EndYrCst EndYrCst_Ind
, EndQtyHnd EndQtyHnd_Ind
, EndQtyHld EndQtyHld_Ind
, SESSION_USER
, 'IMLFADJSP'
, AdjTid;
SQL0104 Position 41 Token BGNYRCST_IND was not valid.

Execute IMLFADJSP_STMT Using BgnYrCst INDICATOR BgnYrCst_Ind
, EndYrCst INDICATOR EndYrCst_Ind
, EndQtyHnd INDICATOR EndQtyHnd_Ind
, EndQtyHld INDICATOR EndQtyHld_Ind
, SESSION_USER
, 'IMLFADJSP'
, AdjTid;
SQL0199 Position 41 Keyword INDICATOR not expected.


Nothing is accepted. What is wrong? Thanks.

Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.