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



Hi,

TempTable is not an existing table it is nothing else than a temporary view
which is only available for the CurAuto cursor, i.e. it even cannot be used
by other SQL statements within his source.

Is it really TempTable which is not found or is it TDTasks or TDActions or
QAOKP03A?

IMHO when opening the cursor the library list is not yet correctly or
completely set!

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 Dave
Gesendet: Sunday, 09. August 2009 18:22
An: RPG programming on the IBM i / System i
Betreff: Re: TempTable not found error - SQL0204

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.