Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alter table with out delete the data

suman amaraAug 18 2014 — edited Aug 18 2014

Hi Team,

I am adding a column, but I am getting data should delete...  who can i solve it?

Error starting at line : 21 in command -

DECLARE

--

  BEGIN

  --

      EXECUTE IMMEDIATE 'ALTER TABLE ge_gifts ADD PROMO_SYS VARCHAR2(10) not null';

  --

  EXCEPTION WHEN OTHERS THEN

      IF SQLCODE = '-01430'   THEN

         NULL ;

      ELSE

         RAISE ;

      END IF ;     

--

END ;

Error report -

ORA-01758: table must be empty to add mandatory (NOT NULL) column

ORA-06512: at line 11

01758. 00000 -  "table must be empty to add mandatory (NOT NULL) column"

*Cause:   

*Action:

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2014
Added on Aug 18 2014
4 comments
487 views