DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: replace function

  1. #1
    dennis Guest

    replace function


    I am using SQL7 and I need to use the replace function. My goal is to update
    a field in a table. I need to turn all lowercase 'cps' to uppercase 'CPS'.
    This is what I came up with:
    Update agency
    set agencyname = replace(agencyname, 'cps', 'CPS')

    I get an error when I do this though. Error:[Microsoft][ODBC SQL Server [Microsoft][ODBC
    SQL Server Driver][Shared Memory]ConnectionCheckForData (CheckforData()).
    [Microsoft][ODBC SQL Server Driver][Shared Memory]General network error.
    Check your network documentation.

    Connection Broken


  2. #2
    Matthew mark Guest

    Re: replace function


    Dennis,

    I don't know for sure, but I found this curious. I presume you already fixed
    it. However, if not, what if you do this...

    Update Agency
    Set agencyname='CPS'
    where agencyname='cps'

    ?

    Matthew

    "dennis" <dtucker01@hotmail.com> wrote:
    >
    >I am using SQL7 and I need to use the replace function. My goal is to update
    >a field in a table. I need to turn all lowercase 'cps' to uppercase 'CPS'.
    >This is what I came up with:
    >Update agency
    >set agencyname = replace(agencyname, 'cps', 'CPS')
    >
    >I get an error when I do this though. Error:[Microsoft][ODBC SQL Server

    [Microsoft][ODBC
    >SQL Server Driver][Shared Memory]ConnectionCheckForData (CheckforData()).
    >[Microsoft][ODBC SQL Server Driver][Shared Memory]General network error.
    >Check your network documentation.
    >
    >Connection Broken
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center