DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Uppercase

  1. #1
    Join Date
    Feb 2001
    Location
    Belgium, Sint-Truiden
    Posts
    82

    Question

    Fellow Oracle enhousiasts,

    is there a way to define fields in a table so they only accept (or translate to ) uppercase?

    Thx,

    Rik

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    If that is a hard and fast rule, I would put a before-insert trigger on the table and convert the values to upper-case before you insert them into the table.
    Jeff Hunter

  3. #3
    Join Date
    Feb 2001
    Posts
    184
    If you are Inserting these values from the Front End, Very easy cahnge the property to Upper, No Trigger , no headache.

    If not from Front end, There are 2 ways.

    1 Before Insert Trigger can do that.
    2- Have a Check Constranit for Upper.

    Thanks

  4. #4
    Join Date
    Feb 2001
    Location
    Belgium, Sint-Truiden
    Posts
    82
    I've made a trigger like this:
    TRIGGER txperson_ucase
    before insert or update on txperson
    begin
    insert into txperson
    values (PERSONID,
    LASTNAME,
    FIRSTNAME,
    upper(USERID),
    upper(PASSWORD),
    ADDRESSID,
    STARTdate,
    ENDdate,
    AVAILABILITY,
    REGISTRATIONPHASE,
    CREATION,
    CREATORID,
    MODIFICATIONID,
    MODIFICATORID);
    commit;
    end;

    where fields userid and passwod are to be put in uppercase.
    Is this the right way (how does oracle know which values to take?),

    Thx,


    Rik

  5. #5
    Join Date
    Mar 2001
    Posts
    22
    Arbe,

    The trigger is very simple.

    create trigger txperson_ucase before insert or update on txperson for each row

    begin
    :new.USERID := upper(:new.USERID);
    :new.PASSWORD := upper(:new.PASSWORD;
    end;
    /
    hptse

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