Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

temporary table

Status
Not open for further replies.

simanek

Programmer
Jan 19, 2001
137
US
Hi all,

I have a function that relies on an empty temporary table all of the time. So what I'm trying to do is the following
//create 'Qualify' table if not already there
create global temporary table if not exists Qualify(
val1 VARCHAR(4)
val2 VARCHAR(2)
val3 VARCHAR(3)
on commit preserve rows;
note: this doesn't work and i'm not sure why.
what i would like to do is check if the table exists and if it does, delete everything in it. Any ideas how I would do this? I'm in a java environment if that helps at all. Thanks. Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
 
Your create statement is invalid for there is no "if not exists" clause in create table statement. You may try to delete everything from your table and catch the error if any (trying to create a new one in error handler ).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top