Archives of the TeradataForum
Message Posted: Wed, 20 Feb 2008 @ 17:16:32 GMT
Subj: | | Re: Conditional Table Drop |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Wed, 20 Feb 2008 12:15 -->
we do conditional table drops in stored procs:
we've already set values for the v_result_db and v_result_table
/* Conditional Drop Result table */
SET v_temp = 0;
SELECT 1
INTO v_temp
FROM DBC.TABLES
WHERE DATABASENAME = TRIM(v_result_db)
AND TABLENAME = TRIM(v_result_table);
IF v_temp = 1 THEN
SET v_drp_tbl_str = 'DROP TABLE '
||TRIM(v_result_db)
||'.'
||TRIM(v_result_table);
/* Execute the sql string to drop the table */
CALL DBC.SYSEXECSQL(v_drp_tbl_str);
END IF;
Thanks
|