IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Insertion of Apostrophe vale in DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Mon Dec 22, 2008 1:20 pm
Reply with quote

Hi,

I want to insert an apostrophe value in DB2 varchar field.
What will be the syntax of that??

for eg.: THOMSON'S 75X104 HME1

Please let me know.
Back to top
View user's profile Send private message
atosvv

New User


Joined: 04 Dec 2008
Posts: 11
Location: Mumbai

PostPosted: Mon Dec 22, 2008 2:11 pm
Reply with quote

Hi,


Code:

create table vv9(name varchar(45), no integer);
insert into vv9 values(('Insert'||''''||'Apostrophe'), 100);
select * from vv9;

The result is
NAME              NO
Insert'Apostrophe 100



Will it useful...

Thanks.

-VV
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Dec 22, 2008 3:11 pm
Reply with quote

Hi,

Where are you executing your query ?
1) If its a cobol code, you may easily populate your string to the host variable and use insert verb should work. I don't think there should be any problem because of apostrophe.

2) If you want to run the query in SPUFI, you may try using hex values for apostrophe.

eg: select "thomson||x'7D'||is good" from sysibm.sysdummy1 ;

Please let me know if this works.
Thanks,
-Kapil.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Date insertion returns -180 CICS 1
No new posts Sending IMS (DBCTL) command and get r... CICS 2
No new posts How to delimit data with '|' which ha... DFSORT/ICETOOL 5
No new posts Dropping all Apostrophe's DB2 3
No new posts PDS member insertion into a GDG dataset JCL & VSAM 8
Search our Forums:

Back to Top