2 Replies Latest reply: Jan 15, 2013 4:07 PM by rp0428 RSS

    Add default Column as Boolean while creating table

    chekku
      Hi,

      I am trying to create a table with default value for boolean data as shown below:


      CREATE TABLE test_users (
      user_id number(11) NOT NULL PRIMARY KEY,
      first_name varchar2(50),
      last_name varchar2(50),
      email varchar2(100),
      user_password varchar2(100),
      zip_code varchar2(50),
      title varchar2(100),
      description varchar2(2000),
      picture_path varchar2(2000),
      one_time_activation number(1) default null check(one_time_activation in(0,1)),
      one_time_activation_code varchar2(100),
      is_active number(1) default null check(is_active in(0,1)),
      security_question_id number(11),
      security_answer varchar2(100),
      inserted_date datetime,
      modified_date datetime,
      is_deleted number(1) default 0 check(is_deleted in(0,1)),
      last_login_date datetime,
      no_of_views number(20) DEFAULT 0,
      is_redirect_to_edit_profile number(1) default 1 check(is_redirect_to_edit_profile in(0,1)),
      present_login_date datetime,
      is_interested_ab_membership number(1) default 0 check(is_interested_ab_membership in(0,1)),
      joined_date datetime,
      removed_date datetime,
      is_admin_deleted number(1) DEFAULT 0 check(is_admin_deleted in(0,1)),
      moderated_by number(11),
      is_subscribe_newsletter number(1) DEFAULT 0 check(is_subscribe_newsletter in(0,1)),
      user_pagination number(3) DEFAULT 15
      );

      but i am getting
      Error at line 1
      ORA-00902: invalid datatype

      thanks