Replace first Letter in a field Oracle

Posted by Stanley on Stack Overflow See other posts from Stack Overflow or by Stanley
Published on 2012-11-06T16:36:28Z Indexed on 2012/11/06 17:00 UTC
Read the original article Hit count: 148

Filed under:

Hi Guys I have this Table My Original table

I need to replace the First Letter in ACCT_NAME with the First Name of ACCT_SHORT_NAME. Records like the Higliighted(RAFFMAN) should not be changed. I have tried:

select acct_name, ACCT_SHORT_NAME,replace(acct_name, substr(acct_name, 1, 1),      ACCT_SHORT_NAME)
 from tbaadm.gam where schm_type = 'TDA' and rcre_user_id  = 'SYSTEM' and substr(acct_name,2,1) = ' '

I am getting:

Table after select

This means that am Picking the whole value in ACCT_SHORT_NAME. WHat is the best way to do what am trying to do?

© Stack Overflow or respective owner

Related posts about oracle11g