Results 1 to 4 of 4

Thread: Init caps

  1. #1
    Join Date
    Apr 2003
    Posts
    176

    Unanswered: Init caps

    I have a table with columns job_name,department,city.They are strings like
    job_name=software engineer
    city=new hampshire
    department= clinical labs.This is one row in the table which is having tousands of rows.
    I wanted to convert this data to the format Software Engineer,New Hampshire,Clinical Labs
    The first letter of the each word should be of capital.
    Can anyone tell me a stored procedure or some other way to acieve this..

  2. #2
    Join Date
    Apr 2002
    Posts
    31
    update table
    set job_name=upper(substring(job_name,1,1))+substring( job_name,2,len(job_name)-1)

    HTH,
    OBRP

  3. #3
    Join Date
    Jan 2003
    Location
    Duncan BC Canada
    Posts
    80
    OBRP: That will only capitalize the first word of the string.

    You'd have to search the string for spaces, mark the character after each space as the start of a new word, and then capitalize those.

    Someone must have written an 'initcap' function...
    Bradley

  4. #4
    Join Date
    Oct 2002
    Location
    Western part of Georgia, USA
    Posts
    123
    I ran across this the other day and have not tried it, but it may fit your needs. Go here http://www.planet-source-code.com/vb...d=581&lngWId=5

Posting Permissions

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