Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to type cast ' and , in Spufi while inserting records
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Mar 19, 2008 3:47 pm    Post subject:
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Mar 19, 2008 4:16 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us