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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Volatile table existence check

Status
Not open for further replies.

rrrkrishnan

Programmer
Jan 9, 2003
107
US
Can someone please help me here.
I would like to check if a volatile table that I am trying to create already exists. If not, I would want to create it, if it exists already, I do not want the script to fail.
So is there a way to do this in a bteq script.

Thanks!!!
 
Just use some error code trapping as follows:

create volatile table testtab
(Col1 integer
)
primary index(col1)
;

/* Does table already exist - 3803 error */
.IF ERRORCODE = 3803 THEN .GOTO CONT_LAB
.IF ERRORCODE <> 0 THEN .QUIT ERRORCODE

.LABEL CONT_LAB

...

Hope this helps

Si M...

 
Thanks, but would still like to know if there is any way to prevent this error msg appearing in the log.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top