Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL: Altering tablespace in a function
hi!
I am trying to ALTER tablespace into read write mode and into read only mode via scripts/functions but I am getting ORA-01031 error.
First I created a very simple script like this exampe:
ScriptA.sql:
alter tablespace A read write;
alter tablespace B read write;
alter tablespace C read write;
The first script above I ran as user SYSTEM and I also ran the other script below as SYSTEM and I also created the function in schema SYSTEM.
the script is similar to this:
scriptB.sql
DECLARE
v_rc INTEGER;
BEGIN
v_rc := f_ReadWrite;
EXCEPTION
when others then
dbms_output.put_line(SQLERRM);
END;
the function is similar to this:
CREATE OR REPLACE FUNCTION f_ReadWrite
IS
v_cursor NUMBER := DBMS_SQL.OPEN_CURSOR; v_rc INTEGER; v_text VARCHAR2(100) := 'ALTER tablespace A read write';BEGIN
What am I doing wrong? I would really appreciate any advice you can give me..
TIA,
Magnus Lassi
Received on Tue Jan 26 1999 - 04:16:52 CST
![]() |
![]() |