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

Translate SQL


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

New User


Joined: 31 Aug 2012
Posts: 25
Location: Australia

PostPosted: Thu Sep 05, 2013 7:11 pm
Reply with quote

Hi ,
I am trying to use below SQL to update a column of a table
Code:
 UPDATE TABLE owner.table
SET COL1 = TRANSLATE (COL1,'A,B')


After execution of SQL in SPUFI , the col1 data is turning into blank instead of converting all B's to A.

What is wrong I am doing , how can i correct the SQL , I want to replace a particular character in a column with some other character .

Thanks for your help .

Regards
Carol
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Sep 05, 2013 7:55 pm
Reply with quote

Translate uses three parameters. However, you are passing only two. You should match the quote after A so that B is recognized as third parameter.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 05, 2013 7:56 pm
Reply with quote

The syntax is incorrect; instead of supplying three parameters to TRANSLATE, you have only supplied two.
Back to top
View user's profile Send private message
Jimy Carol

New User


Joined: 31 Aug 2012
Posts: 25
Location: Australia

PostPosted: Thu Sep 05, 2013 9:42 pm
Reply with quote

Thanks for help , I correcte the syntax as suggested by you and the sql works fine now . Thanks again for 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 Need help with TRANSLATE() CLIST & REXX 7
No new posts Translate UPPER CASE to lower case PL/I & Assembler 0
No new posts How to put a translate variable in th... JCL & VSAM 1
No new posts Translate Unicode to Decimal CLIST & REXX 5
No new posts Utility for Translate & compile C... Mainframe Interview Questions 8
Search our Forums:

Back to Top