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
 

 

Translate SQL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Translate SQL
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: 686
Location: Earth

PostPosted: Thu Sep 05, 2013 7:55 pm    Post subject:
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: 1772
Location: Bloomington, IL

PostPosted: Thu Sep 05, 2013 7:56 pm    Post subject:
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    Post subject:
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    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 Translate UPPER CASE to lower case steve-myers PL/I & Assembler 0 Mon Oct 19, 2015 9:33 am
No new posts How to put a translate variable in th... vasco ferreira JCL & VSAM 1 Wed Nov 03, 2010 2:19 pm
No new posts Translate Unicode to Decimal HameedAli CLIST & REXX 5 Wed Dec 09, 2009 1:14 pm
No new posts Utility for Translate & compile C... Amolondhe007 Mainframe Interview Questions 8 Thu Aug 13, 2009 1:20 pm
No new posts Translate to replace the string chara... PeD PL/I & Assembler 6 Wed Feb 04, 2009 4:09 pm


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