newbie question
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: newbie question

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    5

    newbie question

    Hello guys,

    Say i have have this table:

    CREATE TABLE Membre
    (noMembre CHAR(8),
    nomMembre VARCHAR(30) NOT NULL,
    prenomMembre VARCHAR(30) NOT NULL,
    adresseMembre VARCHAR(30) NOT NULL,
    dateNaissMembre DATE NOT NULL,
    dateInscriptionMembre DATE NOT NULL,
    adresseCourrielMembre VARCHAR(100),
    noClub INTEGER,
    PRIMARY KEY (noMembre) ... ... ...

    If I want to check that the column say... "nomMembre" has it's first four letters all in uppercase, how can I do it? I was trying with CHECK(UPPER(SUBSTR but i think I'm not using it good...

    Any help is appreciated!

    Thanx!!!

    Stephane

  2. #2
    Join Date
    Jul 2003
    Location
    Sofia, Bulgaria
    Posts
    91
    This way it worked:
    create table mytest(v varchar2(10) check (upper(substr(v, 1, 4)) = substr(v, 1, 4) ))
    tablespace users;

Posting Permissions

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


Click Here to Expand Forum to Full Width