Results 1 to 4 of 4

Thread: sqlplus-need help

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    107

    sqlplus-need help

    This is my table. I need to add a null constraint using alter table.

    alter table gradstudent
    add constraint gradstudent_sfname_nn not null(s_fname);

    alter table gradstudent
    add constraint gradstudent_slname_nn not null(s_lname);

    What am I doing wrong? Is it possible to put it in one statement?

    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    S_ID NUMBER(3)
    S_LAST VARCHAR2(10)
    S_FIRST VARCHAR2(10)
    S_MI CHAR(1)
    S_ADD VARCHAR2(25)

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    hum, are you specifying the right column name in your add constraints?
    s_fname, s_lname are not the same as S_LAST and S_FIRST of your select...


    Ammo
    Credit travels up, blame travels down -- The Boss

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    107
    yes, the database just prints everythimg in caps.
    Here is my table part of the script. Would it be better to use a modify statement?

    create table student
    (
    s_id number(3),
    s_last varchar2(10),
    s_first varchar2(10),
    s_mi char(1),
    s_add varchar2(25)
    );

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Posts
    1,027
    that's my point, it's not just diffrent caps, one is "s_last" the other is "s_lname"! Same with "s_first" and "s_fname"...

    Ammo
    Credit travels up, blame travels down -- The Boss

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •