If there is Oracle table is deleted, as well as other statements

declare

      num number; // declare a type number type parameter a 

begin

    select count(1) into num from user_tables where table_name = upper('temp1') ;

// inquiry into the number table temp1

    if num > 0 then

        execute immediate 'drop table temp1' ;

// inside a stored procedure is used in dynamic execution of SQL statements.

    end if; // end if statement

end; // end of this program

Using a stored procedure to remove the table temp1;

If sqlite to use drop table if exists temp1;

Reproduced in: https: //www.jianshu.com/p/7bb5c38ea6c3

Guess you like

Origin blog.csdn.net/weixin_33859231/article/details/91109620