DECLARE
sqlstr VARCHAR2(200);
handle NUMBER;
dummy NUMBER;
sTable varchar2(80);
BEGIN
select table_name into sTable from user_tables
where table_name = 'TT';
--if sTable = null then
--end if;
EXCEPTION
WHEN NO_DATA_FOUND THEN
sqlstr := 'create table tt(iddd int)';
handle := dbms_sql.open_cursor;
dbms_sql.parse(handle, sqlstr, dbms_sql.NATIVE);
dummy := dbms_sql.execute(handle);
dbms_sql.close_cursor(handle);
RAISE;
end;
oracle-检查对象存在与否,并建立相应对象--plsql中使用DDL语句如Create 等
最新推荐文章于 2024-04-23 10:38:13 发布