By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

Check temporary table existing

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.