Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 788
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: 6968
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: 788
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us