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 -> any ideas on why this pice of code dosnt work??

any ideas on why this pice of code dosnt work??

From: Vinay Bhushan <bhushanvinay_at_gmail.com>
Date: 8 Aug 2006 09:47:39 -0700
Message-ID: <1155055659.151278.191510@m73g2000cwd.googlegroups.com>


DECLARE
        v_userTabColumns INT;
BEGIN

     SELECT COUNT(*) INTO  v_userTabColumns
     FROM  USER_TAB_COLUMNS
     WHERE TABLE_NAME ='T'
           AND COLUMN_NAME ='ABCD';

     IF v_userTabColumns >0 THEN
        DBMS_OUTPUT.PUT_LINE ('<<ABCD>><<T>> already Exists');
     ELSE
        ALTER TABLE T   ADD (ABCD VARCHAR2(50));
        DBMS_OUTPUT.PUT_LINE ('New column <<ABCD>> for <<t>>
created.');
     END IF;

END; Received on Tue Aug 08 2006 - 11:47:39 CDT

Original text of this message

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