Re: Alter Table in PL/SQL

From: Marino Ljubic <mljubic_at_globalnet.hr>
Date: Wed, 26 Oct 2005 13:34:21 +0200
Message-ID: <djnplj$19i$1_at_ss405.t-com.hr>


"willpwr" <william.cook_at_kla-tencor-dot-com.no-spam.invalid> wrote in message news:y7ydnVJhIYCuscLeRVn_vA_at_giganews.com
> I am using the following statement:
> ALTER TABLE abc ENABLE PRIMARY KEY;
> This statement works fine if I issue it in SQLPlus. It also works
> fine inside a simple sql script. However it does not work in the
> following PL/SQL script:
>
> BEGIN
> ALTER TABLE abc ENABLE PRIMARY KEY;
> END;
> /
>
> I get an error on the Alter Table line stating that another statement
> was expected and then it provides a long list of nearly all PL/SQL
> statements. Is there something I have to do before I can use an Alter
> Table statement after a Begin statement in a script?
> Thanks for your time.

BEGIN
      EXECUTE IMMEDIATE('ALTER TABLE abc ENABLE PRIMARY KEY'); END; Received on Wed Oct 26 2005 - 13:34:21 CEST

Original text of this message