DECLARE
vCursor NUMBER;
vCreateString VARCHAR(200);
vDropString VARCHAR2(200);
BEGIN
vCursor := dbms_sql.open_cursor;
vDropString := 'Drop Table cux_sql';
--drop table
BEGIN
dbms_sql.parse(vCursor, vDropString, dbms_sql.native);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(dbms_utility.format_error_stack);
END;
--create table
vCreateString := 'Create Table cux_sql
(
a varchar2(10),
b varchar2(10)
)';
dbms_sql.parse(vCursor, vCreateString, dbms_sql.native);
dbms_sql.close_cursor(vCursor);
EXCEPTION
WHEN OTHERS THEN
dbms_sql.close_cursor(vCursor);
dbms_output.put_line(dbms_utility.format_error_stack);
END;
沒有留言:
張貼留言