Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: why cant i do this?? any clues on how i should go about
Vinay Bhushan wrote:
> Thanks for the reply,
>
> but what do you propose me to do insted of using a Execute immidiate;
>
> i would like to create the col if not existing;
>
> how would i achive it.
>
> Regards
> Vinay
>
>> ALTER TABLE is a DDL statement. DDL statements need e
>> EXECUTE IMMEDIATE '<statement>'
>>
>> However, IMO, ALTERing a table in PL/SQL is a *VERY BAD IDEA*.
>>
>> --
>> Sybrand Bakker, Senior Oracle DBA
Propose first that you stop top posting.
Secondly propose that you NEVER alter tables using PL/SQL. That is a bad practice and that is what Sybrand cautioned you against.
However ... to perform DDL you need to use dynamic SQL either in the form of Native Dynamic SQL (NDS) or the DBMS_SQL or the DBMS_DDL built in packages. All of which are documented in Morgan's Library at www.psoug.org.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Aug 08 2006 - 12:50:44 CDT