Unix Technical Forum

Delimiting Single and Double Quotes

This is a discussion on Delimiting Single and Double Quotes within the DB2 forums, part of the Database Server Software category; --> After searching this forum, I think I've got delimiters right for single quotes. but I'm still lost on double ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 03:56 PM
Randy
 
Posts: n/a
Default Delimiting Single and Double Quotes

After searching this forum, I think I've got delimiters right for
single quotes. but I'm still lost on double quotes. Here's what I'm
after:

Update .... set mytext = 'O''Brien said, "I inserted quotes,"
yesterday.'

The O'Brien gets delimited with two single quotes to replace the one
between O and B, but what do I need to get the quotes around ->I
inserted quotes,<- ?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 03:57 PM
dotyet
 
Posts: n/a
Default Re: Delimiting Single and Double Quotes

The following works for me:

C:\SQLLIB\BIN>db2 "select '\"This is so cool\"' from syscat.tables
fetch first 1 rows only"

1
-----------------
"This is so cool"

1 record(s) selected.


C:\SQLLIB\BIN>db2 "select '''This is so cool''' from syscat.tables
fetch first 1 rows only"

1
-----------------
'This is so cool'

1 record(s) selected.


hth,
dotyet


rchrismon@fragomen.com (Randy) wrote in message news:<dae79e25.0311031240.2ad2f1fc@posting.google. com>...
> After searching this forum, I think I've got delimiters right for
> single quotes. but I'm still lost on double quotes. Here's what I'm
> after:
>
> Update .... set mytext = 'O''Brien said, "I inserted quotes,"
> yesterday.'
>
> The O'Brien gets delimited with two single quotes to replace the one
> between O and B, but what do I need to get the quotes around ->I
> inserted quotes,<- ?
>
> Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com