Options

Problem with "drop table"

Hello!!!
When we modify a field type in a table RedGate generates a temporary table and then the drop table.
However errors can occur when inserting into the temporary table.
Example: tablespace "unable to extended tablespace", or "parent keys not found".
If an error occurs, the temporary table is not loaded and the "core" table is dropped.
In order for this not to occur it would be necessary to enter the command below in the script. "WHENEVER SQLERROR" so any error that occurs execution will stop immediately and the core table will not be dropped
EXAMPLE: CREATE TABLE TB_ALUNOS_TEMP (ALUCOD VARCHAR2(100)) / WHENEVER SQLERROR EXIT SQL.CODE INSERT INTO TB_ALUNOS_TEMP (ALUCOD) SELECT ALUCOD FROM ALUNOS / WHENEVER SQLERROR CONTINUE DROP TABLE ALUNOS /

Sign In or Register to comment.