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: Create a table in a procedure

Re: Create a table in a procedure

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Thu, 19 Dec 2002 15:14:58 GMT
Message-ID: <SnlM9.275171$GR5.93132@rwcrnsc51.ops.asp.att.net>


Look at Tom's site. http://asktom.oracle.com I think you need to add a pargma to the stored procedure. Jim
"Andrew" <landau1999it_at_yahoo.it> wrote in message news:e4d18387.0212190602.5b0a839a_at_posting.google.com...
> FIrst of all Marry Christmas and Happy new Year to all people around.
> I'm a newbie on a Oracle DB world and I need need to create a procedure
like that
>
> PROCEDURE sp_GenerateTable(idLabel IN number) IS
> BEGIN
> -- Find the name of the table to create
> SELECT TableName INTO tableToCreate FROM LABEL
> WHERE LABELID = idLabel;
>
> -- sp_CreateTable(tableToCreate);
>
> EXECUTE IMMEDIATE 'CREATE TABLE '|| tableToCreate ||'
> (
> STAR varchar2(200),
> WARS varchar2(100)
> )';
>
> END;
>
> -- Eventually
>
> procedure sp_CreateTable(tableName IN varchar2) IS
> BEGIN
> EXECUTE IMMEDIATE 'CREATE TABLE '|| tableName ||'
> (
> TSAT varchar2(200),
> WARS varchar2(100)
> )';
> END;
>
> +++++++++++++++++++++++++++++++++++++++++++++++++
>
> but when I try ti execute the procedure I get this error
>
> SQL> exec pckTableManager.sp_generatetable(2);
> BEGIN pckTableManager.sp_generatetable(2); END;
>
> *
> ERRORE alla riga 1:
> ORA-04068: lo stato esistente dei package è stato eliminato
> ORA-04061: lo stato esistente di package "CSGD.PCKTABLEMANAGER" è stato
> invalidato
> ORA-04065: esecuzione non effettuata, modifica o eliminazione di package
> "CSGD.PCKTABLEMANAGER"
> ORA-06508: PL/SQL: impossibile trovare unità lib chiamata
> ORA-06512: a line 1
>
> (sorry it's a Ora9i on italian version. I hope that the error number will
suffice).
> Thanks for the help and happy holydays to all !
Received on Thu Dec 19 2002 - 09:14:58 CST

Original text of this message

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