View previous topic :: View next topic |
Author |
Message |
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Wed Jan 04, 2006 11:53 pm Post subject: DB2-QMF-Temp Table |
|
|
Hi,
I am declaring a Temporary Table and Trying to Select the columns declared in the Temp Table (Obviuosly , at this time, there won't be any values).
PROC
Quote: | RUN QUERY UID.Q1
RUN QUERY UID.Q2 |
UID.Q1
Quote: | DECLARE GLOBAL TEMPORARY TABLE TEMP
(ID CHAR(09) ,
AMC1 CHAR(09) ,
AMC2 CHAR(01) ,
AMC3 CHAR(01)
); |
UID.Q2
Quote: | SELECT * FROM TEMP; |
The error I am seeing is,
Quote: | TEMP could not be found.
Explanation:
The query refers to TEMP.
Nothing with this name exists in the database.
Suggested Action:
Check for a spelling error. |
I am Declaring and Selecting in the same session.
Can someone here help me with
- what I have to really check before doing a DECLARE of Temp Table
- how to check the required objects whether it exists or not
- a way to work with Temp Table in QMF
I am not trying to do this in Batch. Upon running the query, I am expecting to see the result in the desired Report.
Suggestion and Question to help you out in solving the issue are most welcome. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Jan 05, 2006 9:52 am Post subject: |
|
|
sakreg,
After going through Kolusu's link, try out running the same set of declare and select statements in the same file using SPUFI.
I will leave it to you to try it out and publish the results here. Comparing the results between QMF and SPUFI, and reading the material in Kolusu' link will make everything clear to you.
Let us know if you still have questions.
HTH...Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
|
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Thu Jan 05, 2006 11:28 pm Post subject: |
|
|
I am able to execute the SQL's successfully in SPUFI. But when it come to QMF, it fails to run. This is Strange! Since the Qry run fine in SPUFI, we can conclude that the necessary Tablesapce and Dataspace are in place. Am I missing anything else in QMF? |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Fri Jan 06, 2006 10:19 am Post subject: |
|
|
sakreg,
That can only mean that QMF does not support declared temporary tables. Which version of QMF are you using?. If my memory serves me right, I remember reading a APAR somewhere that QMF v6 does not support declared temporary tables.
Declared temporary tables came very recently (as an enhancement to DB2 v6) and so it is not surprising that QMF does not support them.
BTW...Just curious...What exactly is the requirement of using declared temporary tables from QMF.
Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
|
|
|