ORA-01031: insufficient privileges

oracle United States
  • 13 years ago
    hi
    how can i grant privileges to SCOTT user
    to use Dynamic SQL in this code.


    create or replace package dsql is
    procedure make(name varchar2,col varchar2);
    procedure add (name varchar2,col1 varchar2,col2 varchar2:=NULL);
    procedure up (name varchar2,col2 varchar2,setval varchar2,con varchar2);
    end dsql;
    /
    show error


    create or replace package body dsql is
    procedure ex (stm varchar2) is
    begin
    DBMS_OUTPUT.PUT_LINE(stm);
    EXECUTE IMMEDIATE stm;
    end ex;

    procedure make(name varchar2,col varchar2) is
    st varchar2(200):='create table ' || name ||' ' || '('||col || ')';
    begin
    ex(st);
    end make;
    procedure add (name varchar2,col1 varchar2,col2 varchar2:=NULL) is
    begin
    NULL;
    END add;
    procedure up (name varchar2,col2 varchar2,setval varchar2,con varchar2) is
    begin
    NULL;
    end up;
    end dsql;
    /
    show error


    create table rafeekt (id varchar2(10),name varchar2(10))

    begin
    *

    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SCOTT.DSQL", line 5
    ORA-06512: at "SCOTT.DSQL", line 11
    ORA-06512: at line 2






    how can i solve this problem

    Thanx
    Rafeek















































  • 13 years ago

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The greatest performance improvement of all is when a system goes from not-working to working.” - John Ousterhout