🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.databases.oracle.misc
4 messages
4 total messages Started by Steve Agnew Thu, 22 Oct 1998 00:00
Help - SQL update of character field in table
#22
Author: Steve Agnew
Date: Thu, 22 Oct 1998 00:00
16 lines
1212 bytes
I'm new to SQL Plus, so I hope this question isn't to stupid...

I would like to know how to update a character field in a table when the 
information being added contains a single-quote.

For example, the following works fine:
     update tablex set description='Up the creek' where response=1
but
     update tablex set description='Up Miller's creek' where response=1
comes back with an error.

Is there some way to get around this problem?

I would appreciate any assistance.

Steve
Re: Help - SQL update of character field in table
#23
Author: Izabella
Date: Fri, 23 Oct 1998 00:00
22 lines
1376 bytes
Try using two single quotes (NOT a double quote) when you want to insert a
quote, eg:
    update tablex set description='Up Miller''s creek' where ...

Steve Agnew wrote in message
<7vOX1.90$sE6.410121@NewsRead.Toronto.iSTAR.net>...
>I'm new to SQL Plus, so I hope this question isn't to stupid...
>
>I would like to know how to update a character field in a table when the
>information being added contains a single-quote.
>
>For example, the following works fine:
>     update tablex set description='Up the creek' where response=1
>but
>     update tablex set description='Up Miller's creek' where response=1
>comes back with an error.
>
>Is there some way to get around this problem?
>
>I would appreciate any assistance.
>
>Steve
Re: Help - SQL update of character field in table
#24
Author: Boi Hue La
Date: Fri, 23 Oct 1998 00:00
29 lines
1604 bytes
Hi,

Here's the solution:
     update tablex set description='Up Miller''s creek' where response=1

(Two characters of  ' between r and s).

Regards

Steve Agnew wrote:

> I'm new to SQL Plus, so I hope this question isn't to stupid...
>
> I would like to know how to update a character field in a table when
> the
> information being added contains a single-quote.
>
> For example, the following works fine:
>      update tablex set description='Up the creek' where response=1
> but
>      update tablex set description='Up Miller's creek' where
> response=1
> comes back with an error.
>
> Is there some way to get around this problem?
>
> I would appreciate any assistance.
>
> Steve
Re: Help - SQL update of character field in table
#25
Author: Steve Agnew
Date: Sat, 24 Oct 1998 00:00
31 lines
1514 bytes
Problem solved......

Thanks to all who responded by email and in the group.
Using 2 single quotes '' worked.

Steve


In article <7vOX1.90$sE6.410121@NewsRead.Toronto.iSTAR.net>, 
agnews@inforamp.net says...
>
>I'm new to SQL Plus, so I hope this question isn't to stupid...
>
>I would like to know how to update a character field in a table when the 
>information being added contains a single-quote.
>
>For example, the following works fine:
>     update tablex set description='Up the creek' where response=1
>but
>     update tablex set description='Up Miller's creek' where response=1
>comes back with an error.
>
>Is there some way to get around this problem?
>
>I would appreciate any assistance.
>
>Steve
>
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads