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

How to type cast ' and , in Spufi while inserting records


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

New User


Joined: 20 Jan 2007
Posts: 4
Location: Mumbai

PostPosted: Wed Mar 19, 2008 3:17 pm
Reply with quote

Hi,

I am trying to insert records thru spufi. The data which I want to insert has got ' and , in it. However I am not able to insert the data because either it treats it as end of data for the field or continuation to next field.Is there any way to typecast the single quote(') and comma(,) in spufi insert statement?
Back to top
View user's profile Send private message
vaibhav_pal

New User


Joined: 20 Jan 2007
Posts: 4
Location: Mumbai

PostPosted: Wed Mar 19, 2008 3:26 pm
Reply with quote

For Example
INSERT INTO SAMPLETBL VALUES ('ER3,'xyz abc' time')

I am not able to insert the record with the , and ' in the data.

Can anyone provide help on it?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Mar 19, 2008 3:47 pm
Reply with quote

Here values for how many columns are inserted?

Say,

Two columns,

col1 value - ER3
col2 value - xyz abc' time
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 19, 2008 4:10 pm
Reply with quote

for two columns:
Code:

INSERT INTO SAMPLETBL
VALUES ('ER3
       ,'xyz abc' || x'7d' || 'time')


that will insert <xzyabc'time> into the second column.

|| is concatenation
x'7d' is hex for an ebcidc apostrophe (single-quote)
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Mar 19, 2008 4:16 pm
Reply with quote

You have to put one more quote if the value contains a qoute.

To insert this,
Code:
GNANA'S


Use like this,
Code:
'GNANA''S'


What is the problem with comma?

Please post the error message and error code.
Back to top
View user's profile Send private message
vaibhav_pal

New User


Joined: 20 Jan 2007
Posts: 4
Location: Mumbai

PostPosted: Thu Mar 27, 2008 12:06 pm
Reply with quote

It worked with extra quote.
The problem was with the ' symbol and not comma.
Works fine now.
Thanks for all the help.
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 DELETE SPUFI DB2 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top