You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I am calculating the length of a sentence using Length (scalar function), then I also used that keyword in the sentence, but I am having an error for all the queries below:
Error: Missing right parenthesis.
1-SELECT LENGTH('This sentence's length will be calculated') "Length of characters"
FROM dual;
2- SELECT LENGTH('This sentence's 'length' will be calculated') "Length of characters"
FROM dual;
3- SELECT LENGTH('This sentence's "length" will be calculated') "Length of characters"
FROM dual;
4-SELECT LENGTH('This sentence's "\length\" will be calculated') "Length of characters"
FROM dual;
5- SELECT LENGTH('This sentence's '\length\' will be calculated') "Length of characters"
FROM dual;
What should be the correct way to write this query?
Please follow the syntax as i have shown in my previous post.
Oracle 10g allows you to define your own string delimiters to remove the need to double up any single quotes. Any character that is not present in the string can be used as the delimiter:
Code:
syntax as per oracle 9i
DBMS_OUTPUT.put_line('This is Debasis''s string!');
-- New syntax as per 10g.
DBMS_OUTPUT.put_line(q'#This is Debasis's string!#');
DBMS_OUTPUT.put_line(q'[This is Debasis's string!]');