Hi all,
I need to select replace(X,oldvalue,newvalue) from tbl.
I get error message that replace function is not recognize.
I use oledbcommand.
with .net 2.
how can I use replace,substring function.
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Liat AshkenaziPosted Sep 8, 2011, 5:25 AM
Lab is a column in the excel file.
so I want to get the value in the lab column and replace the letter G with L foe example.
Jiteendra SampathiraoPosted Sep 8, 2011, 5:08 AM
SELECT REPLACE('JITENDRA and JAJI','J','G') "OUTPUT" FROM DUAL;
This means.. if J letter is there in the string replace it with G....and OUTPUT is a column_name...
your query is like this select REPLACE('Lab', 'G', 'L') "OUTPUT" from dual
So in the string (Lab) there is no G so it shows an error..
write like this
select REPLACE('Lab', 'L', 'G') "OUTPUT" from dual
your output will be Gab
hope it help you......
Liat AshkenaziPosted Sep 8, 2011, 4:33 AM
Liat AshkenaziPosted Sep 8, 2011, 4:09 AM
I added "output"
and now I get this Error: Syntax error (missing operator) in query expression 'replace([Lab],'G','L') "OUTPUT"'.
what the Output word mean?
Jiteendra SampathiraoPosted Sep 8, 2011, 3:39 AM
The following example replaces occurrences of J with G:
SELECT REPLACE('JITENDRA and JAJI','J','G') "OUTPUT" FROM DUAL;
OUTPUT
--------------
GITEDRA and GAGI
hope it help you....