Actually i want to perform some string operation and the resultset returned by a query, but im not sure how to do it
i have the following query
select types.name as type,parameter.name as name, parameterdefault.defaultvalue as defaultvalue,
WHEN types.name = 'layer' then ''
WHEN types.name = 'p_mil' then ''
where parameter.parameterid = parameterdefault.parameterid
and parameter.typeid = types.typeid
Actually what i wish to do is some case statement,
if types.name = 'layer' then replace ";" with ',' and add
NCE(" ") between each item in the default values,
I can do a case statement, but im not sure how to do a replace
statement from ';' to ',' and add NCE(" ") in each item
Appreciate if someone could guide me here on how to replace
and append some string to the beginning and endding of each and every item item
So if the defaultvalue in the query returned something like 0,1000
when i query, the results returned for defaultvalue column should be NCE("0"),NCE("1000")
select 'NCE("' || replace(defaultvalue, ';', '"),NCE("') || '")'
I'm sure to have made a mistake there somewhere, but you get the idea?
Hi andrewst, yea i got the idea, the code works excellent, thanks a million,
just exactly the same as what i wanted
appreciate it, i didnt knew it can be done in a single replace statement, thought it required some kind of looping between each item..
thank you very much