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: If EXISTS before insert clause

Re: If EXISTS before insert clause

From: Sybrand Bakker <sybrandb_at_hccnet.nl>
Date: Mon, 07 Feb 2005 16:17:28 +0100
Message-ID: <eh1f01dtrg68sbv4c43lvoscnvrd4auk28@4ax.com>


On 7 Feb 2005 07:07:57 -0800, "JPike" <jpike_at_welcom.com> wrote:

>Thanks :) The first one works in a simple test but now I am trying it
>on the whole thing. Here is the first part of my file.
>
>declare
> risk number;
> portfolio number;
>begin
> select count(*) into risk from wst_prd where prd_uid = 502;
> select count(*) into portfolio from wst_prd where prd_uid = 501;
>
> ALTER TABLE WPS_TABL ADD BASE_TABTYP VARCHAR2 (4) NULL;
>.
>.
>.
>
>It errors when it hits the ALTER. Is that an illegal thing to use? The
>error it gives me is that ORA-06550: line 19, column 2:
>PLS-00103: Encountered the symbol "ALTER" when expecting one of the
>following:
>
>and then lists a bunch of other keywords.
>
>I am just trying to understand what is wrong with ALTER?

Alter table is DDL. DDL is only supported in Pl/sql by Execute immediate
Execute immediate 'Alter table ....'
Not sure why you want to perform an alter table in an anonymous PL/SQL block.

--
Sybrand Bakker, Senior Oracle DBA
Received on Mon Feb 07 2005 - 09:17:28 CST

Original text of this message

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