Oracle provides the function DECODE which compares its first argument to one or more search expressions, which are paired with result expressions. Any search or result expression can be null. If a search is successful, the corresponding result is returned. e.g., if the column rating is null, DECODE returns the value 1000:
SELECT DECODE(rating, NULL, 1000, 'C', 2000, 'B', 4000, 'A', 5000)
INTO credit_limit FROM accts WHERE acctno = my_acctno;
Also, one can use the function REPLACE that returns the value of its first argument if its second argument is null, whether the optional third argument is present or not. e.g.,
new_string := REPLACE(old_string, NULL, my_string);
- Rohit.
Quote:
Originally posted by alozano
Hi all,
I have a jsp with some text boxes. This information will be inserted into the database. The user can type single quotas ' or \n or \r. But Oracle does not support these kind of characteres.
How can I replace this information (which is the text box) to make then understable to Oracle?
Is there any function in oracle like replace that I can use it? I havenīt found it.
I have read that you can use urldecoder but I am not sure.
Thanks in advance
Ana.
|