Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    34

    Unanswered: update issue with apostrophe

    UPDATE physician

    SET physician_Cert1_Name='Workers Compensation Medicine' WHERE physician_Cert1_Name='Workers' Compensation Medicine'


    Hi,

    trying to update this table, but how do you handle apostraphes? seems like the easiest way is just to get rid of them. can anyone suggest how to get the above code to run and how you typically handle apostrophe's to avoid the coding error above. Thanks.

    mike

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    does this not work?
    Code:
    UPDATE physician
    
    SET physician_Cert1_Name=
    "Workers Compensation Medicine" 
    WHERE 
    physician_Cert1_Name="Workers' Compensation Medicine"

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    standard sql --
    Code:
    UPDATE physician
       SET physician_Cert1_Name = 'Workers Compensation Medicine' 
     WHERE physician_Cert1_Name = 'Workers'' Compensation Medicine'
    but, i mean, why the update to remove them? apostrophes are good, if'n ya know how to use 'em
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Feb 2007
    Posts
    34
    as always, thanks.

Posting Permissions

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