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

Home -> Community -> Usenet -> c.d.o.server -> Re: procedure and ddl commands?

Re: procedure and ddl commands?

From: <sybrandb_at_yahoo.com>
Date: 26 Jul 2004 07:25:56 -0700
Message-ID: <a1d154f4.0407260625.1277d099@posting.google.com>


"dead" <OVOIZBACI-vlasic_at_vodatel.net> wrote in message news:<ce2fsg$f77$1_at_sunce.iskon.hr>...
> Can someone help me.
> I wolud like to make procedure on server with creating tables, sequences and
> indexes.
> 1. can I put ddl commands in oracle procedures?
> 2. how to put create sequnce command with 'start with' value as result of
> 'select command' (I need max value +1 from table for next value of
> sequence) in procedure?

1 you'll need to use the execute immediate command IMO, creating tables and indexes in a procedure is a BAD idea. You'll loosing control, doing so
2 Issue an ordinary select into to determine your value. Then create the sequence using execute immediate execute immediate 'create sequence foo start with :1' using <the variable you got the result in>

Sybrand Bakker
Senior Oracle DBA Received on Mon Jul 26 2004 - 09:25:56 CDT

Original text of this message

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