Page 1 of 1

Parameter set replacing values

Posted: Fri Jan 02, 2015 4:04 am
by vamsi.4a6
I have one parameter set with different value files

ex-P1 is parameter set and dev1,tst1,prod1 are value files
for P1


select col1,col2 from #P1.tablename#

I have to replace #P1.tablename# with corresponding value from
value file it may by dev1,tst1,prod1.we are calling above sql statment
using NZ connector read from sql file.At run time i will decide the valuefile.


For understanding purpose i gave one parameter but we have so many parameters in sql file.I want to replace all the values from value file it may by dev1,tst1,prod1.


Analysis done so far and clarifications:
1)I will go to Unix path where corresponding value file is present[projectpath/parameterset]

cat valuefilename

but not sure how to replace all the parameterized values in sql file
[#P1.tablename#] based on cat command output.

Posted: Fri Jan 02, 2015 8:59 am
by chulett
You'd need to use something like 'sed' or 'awk'.

Re: Parameter set replacing values

Posted: Mon Jan 05, 2015 9:56 am
by vibwipro
You Can Use
sed 's/Old-Value/New-value/g' :lol: