Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dbms_sql create index

Re: dbms_sql create index

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 8 Dec 2001 08:47:26 -0800
Message-ID: <9utg6u01524@drn.newsguy.com>


In article <6631ab8f.0112072205.e8eeec9_at_posting.google.com>, winw56_at_yahoo.com says...
>
>helo
>
>
>Im trying to create an index on a tb via dbms_sql.open_cursor, dbms_sql.parse
> dbms_sql.execute, dbms_sql.close_cursor
>
>can anyone give me an example of how this is done w/ the full create index
>syntax??

create or replace procedure execute_immediate( p_sql in varchar2 ) is

    cursor_name     pls_integer default dbms_sql.open_cursor;
    ignore          pls_integer;

BEGIN
    dbms_sql.parse(cursor_name, p_sql, dbms_sql.native);     ignore := dbms_sql.execute(cursor_name);     dbms_sql.close_cursor(cursor_name);
END;
/

begin

   execute_immediate('create index t_idx on t(x)' ); end;
/

if you get "insufficient privs", please read:

http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sat Dec 08 2001 - 10:47:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US