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



Nothing that complicated. Here is the cursor:

exec sql
Declare CurAuto Cursor For
With TempTable As
(Select
WOS3LDEN
From
QAOKP03A
Where
WOS3DDEN = :DirEDs.DirE and
WOS3DDGN = 'DA400' and
WOS3LDGN = 'TASKLIST')
Select
*
From
TDTasks, TDActions
Where
TskStatus <> 'Completed' and
TskActID = ActID and
((TskCurUsr = :DirEDs.DirE) or (:DirEDs.DirE = 'QPGMR') or
(TskCurUsr in (Select WOS3LDEN From TempTable)) or
((TskCurUsr = ' ') and
((TskAssTyp = 'U' and TskAssUsr = :DirEDs.DirE) or
(TskAssTyp = 'G' and TskAssUsr in
(Select WOS3LDEN From TempTable)))))
Order By
TskDueDate, TskPrty, TskId;

TdTasks/TdActions are tables that keep the users To-Do Lists - which are assigned by either Directory Entries or membership in Distribution Lists.

The way this is declared, it is my understanding (or at least expectation) that the TempTable would be recreated/refreshed on each Open of the cursor.


--------------------------------------------------
From: "Jim Franz" <jfranz@xxxxxxxxxxxx>
Sent: Sunday, August 09, 2009 9:00 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: Re: TempTable not found error - SQL0204

Is this what you are doing?
<clip from info center>
You can create a temporary table for use with your current session. To
create a temporary table, use the DECLARE GLOBAL TEMPORARY TABLE statement.
This temporary table does not appear in the system catalog and cannot be
shared by other sessions. When you end your session, the rows of the table
are deleted and the table is dropped...
This table is created in QTEMP....</clip>




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.