-
I am trying to use the following procedure for dropping users from the database, the procedure compiles ok but does not seem to work.
create or replace Procedure test (username IN varchar2)
is
cursor_id integer;
sql_string varchar2(200);
BEGIN
cursor_id := DBMS_SQL.OPEN_CURSOR;
sql_string := 'drop user ' | | username | | ' cascade' ;
dbms_output.put_line(sql_string);
DBMS_SQL.PARSE(cursor_id, sql_string , DBMS_SQL.NATIVE);
dbms_output.put_line('user '| | username | | 'dropped');
DBMS_SQL.CLOSE_CURSOR (cursor_id);
EXCEPTION
WHEN OTHERS
THEN
dbms_sql.CLOSE_CURSOR (cursor_id);
dbms_output.put_line('an error occured');
END ;
/
show errors
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|