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 -> cannot call alter table from within block

cannot call alter table from within block

From: <ljunquera_at_my-deja.com>
Date: 2000/08/01
Message-ID: <8m7e9e$fdd$1@nnrp1.deja.com>#1/1

Apparently I cannot call an alter table statement from within a block.

   DECLARE
      lv_col NUMBER;
   BEGIN

      BEGIN
         select count(*)
         into lv_col
         from all_tab_columns
         where table_name = 'EMPLOYEE'
	 and column_name = 'MIDDLE_INITIAL'
	 and owner = 'HR';

         if lv_col = 0
         THEN
            alter table employee add middle_initial varchar(255) null;
         END IF;
      END;

   END; How do I script conditional changes to my database?

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Aug 01 2000 - 00:00:00 CDT

Original text of this message

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