Replace Values for a Col under a Table using Replace Function in Sql Query
601367May 21 2008 — edited May 21 2008Hi 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.