Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Replace Values for a Col under a Table using Replace Function in Sql Query

601367May 21 2008 — edited May 21 2008
Hi all

I have a Custom Table by Name RESP_TABLE which stores the Responsibility Names under the Column RESPONSIBILITY.

The Sample Value for this col is as follows :

PF <CNTRY> Gl Analyst <CCY>.

This <CNTRY> Stands for Country Short Name
and <CCY> Stands for Currency.

The <CNTRY> & <CCY> should be passed as a parameter at the run time.

Based on the value given at the run time it should change accordingly.

For example

PF <CNTRY> Gl Analyst <CCY>

<CNTRY> Value passed at runtime : BE
<CCY> Value passed at runtime : CAD

So the resulting value should be as follows :
PF BE Gl Analyst CAD.

I had already used the query given below :

SELECT REPLACE(RESPONSIBILITY,'<CNTRY>','&MARKET') FROM RESP_TABLE.

This works fine for Country Code alone but not for currency.

I need both the Country Code and Currency Code to be changed to the respective values given at the runtime.

Could anybody please help me on this ?

Regards
Nakul Venkataraman.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2008
Added on May 21 2008
1 comment
349 views