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



You don't actually have the quote symbol in your string do you?

For example, if I do this to simulate having quote signs in the string, it
fails:

select oaname,t.* from qtemp/test t
where oaname not in ('''CMDQRY''')


If that's not it, its still something off about your host variable. You've
proven that by making it work correctly in STRSQL. Maybe try using a not
equal <> operation to see if it processes that correctly.



From: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
To: "RPG programming on the IBM i / System i
(rpg400-l@xxxxxxxxxxxx)" <rpg400-l@xxxxxxxxxxxx>
Date: 06/25/2015 10:12 AM
Subject: declare cursor problem.
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>



I'm sure I'm missing something really simple here, but I just can't see it.

I'm trying to compare authorization lists(last quarter to current)

I'm doing a DSPAUTL in Cl

SO Auth List Last quarter has CMDQRY.
Auth List current I have removed CMDQRY

I want to identify that CMDQRY has been removed. Which works, but I also
want to exclude CMDQRY when simply looking line by line for changes.
Basically trying to prevent it showing up as a change in user as well as
being removed.

code snippet.
EXEC SQL
Declare OLDCURS Cursor for
Select OANAME,OAUSR,OAOBJA, OAOPR,OAOMGT,OAEXS,
OAREAD,OAADD,OAUPD,OADLT
From AUTLDETLM
where OANAME not in(:autllist);

Exec Sql
Open OLDCURS ;

Exec Sql
Fetch OLDCURS into :OANAME, :OAUSR,:OAOBJA,:OAOPR,
:OAOMGT, :OAEXS, :OAREAD,:OAADD,:OAUPD,:OADLT;

Dow SQLSTATE = '00000' ;

When I run the program, autllist contains 'CMDQRY'. But still picks up in
the fetch.
If if copy the select to STRSQL it works correctly and 'CMDQRY' doesn't
show up.
The file AUTLDETLM only exists in my test library.
It seems to be ignoring the where clause.

Anybody see what I might be missing.

Mike



NOTICE: This message, including any attachment, is intended as a
confidential and privileged communication. If you have received this
message in error, or are not the named recipient(s), please immediately
notify the sender and delete this message.
--
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.




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.