468,257 Members | 1,460 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Check temporary table existing

Hello

DB2/NT 8.1.6
In procedure (SQL) I declare GLOBAL TEMPORARY TABLE. Sometimes this
procedure is called twice a session and error creating table occure. I know,
I can create table on session begin. I think I can check in procedure
existing this table and declare or not it. Unfortunately I cannot find how
do it. I don't see item in syscat.tables. What is proper way?

Regards
Yaro
Nov 12 '05 #1
1 2421
Check the SQL Reference Vol. 2 for full details for DECLARE GLOBAL
TEMPRORY TABLE.

It's poor practice to check for the existence of the table and not
execute the DECLARE in the second invocation because there are other
consequences of having a pre-existing table. The "WITH REPLACE" option
should resolve your problem.

Phil Sherman

Yaro wrote:
Hello

DB2/NT 8.1.6
In procedure (SQL) I declare GLOBAL TEMPORARY TABLE. Sometimes this
procedure is called twice a session and error creating table occure. I know,
I can create table on session begin. I think I can check in procedure
existing this table and declare or not it. Unfortunately I cannot find how
do it. I don't see item in syscat.tables. What is proper way?

Regards
Yaro


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Yannick Turgeon | last post: by
reply views Thread by nedbollard | last post: by
7 posts views Thread by Mike Hubbard | last post: by
5 posts views Thread by Adam W. Saxton | last post: by
4 posts views Thread by anorakgirl | last post: by
5 posts views Thread by Alan Little | last post: by
17 posts views Thread by Klaas Vantournhout | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.