Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151

    Unanswered: updating a field with a triggers

    How would i update a field with a triggers to set the column password to something else if the password column = <NULL> on a update.

    thank you very much.

  2. #2
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151

    Re: updating a field with a triggers

    Originally posted by hillcat
    How would i update a field with a triggers to set the column password to something else if the password column = <NULL> on a update.

    thank you very much.


    any help would be helpfull thank you.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    If you want to prevent them from accidentally leaving it NULL (on INSERT), you can use a DEFAULT constraint.

    If you want to prevent them from intentionally setting it to NULL, then you want to use a trigger. The exact syntax for the trigger would depend entirely on what your table structure was and what you wanted to accomplish.

    -PatP

  4. #4
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    as pat said use a default
    or
    i like to really make the trigger work for it's money and create a string for a password that requires some thinking.

    i love substring for this

    select Upper(substring(fname,1,1)) + lower(substring(fname,2,3)) + Lower(substring(lname,1,3))

    jackson browne becomes Jackbro

    i am just having some fun late at night, please dont reply to this.

Posting Permissions

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