Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Delete or Drop a table if it already exists - response (10) by dnoeth

$
0
0
Try the code i posted just replacing 'C917348' and 'ACCT_BASE'. You could also uncheck "Stop query execution if an SQL error occurs" in Options -> Query and then simply run your DELETE or DROP/CREATE tables, errors will be ignored then. When you don't want to ignore errors in other places of your script you must use IF ERRORCODE: DELETE FROM tab; INSERT INTO tab SELECT FROM tab2; .IF ERRORCODE <> 0 THEN GOTO failed; DELETE FROM tab3; INSERT INTO tab3 SELECT FROM tab4; .IF ERRORCODE <> 0 THEN GOTO failed; etc. .EXIT 0 .LABEL failed .EXIT 1btw, i just noticed that my link was dead: http://developer.teradata.com/node/828 Dieter

Viewing all articles
Browse latest Browse all 14773

Trending Articles