Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SELECT but not UPDATE

    If I have used SELECT to review a row of data from a table and then only want to allow it to UPDATE certain fields, even if the other fields were changed, would I use the UPDATE command, and choose which fields can be updated? Will this stop the other fields from being updated? I am trying to prevent people from changing certain values in the table.

  • #2
    New Coder
    Join Date
    Jul 2006
    Location
    Cincinnati, OH
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yeah, the UPDATE will only change the fields that you tell it to in the SET part of the query.

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    If the users have UPDATE privileges on the table then they can set whatever columns they want.

    What you can do though is set individual column_priv (column privileges) for the table and then they can only update the columns you allow them to do. I've never done that at the column level.

    Here is an article that might help you understand how to do that at the column level.
    Last edited by guelphdad; 08-10-2006 at 03:22 PM.

  • #4
    Regular Coder
    Join Date
    Jul 2006
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The people will be viewing it through an online form that they can access, but I don't want someone to update fileds that someone else has filled in, but I need them to be able to review them. They will have an opportunity to complete other fields, which obviously would need to be updated.

  • #5
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Just echo the value from the database then. Don't give them a text box to update it.

  • #6
    Regular Coder
    Join Date
    Jul 2006
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have used UPDATE table set fields to update WHERE Row to only allow certain fields to be updated.... I hope this will work


  •  

    Posting Permissions

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