What would you do to execute the query successfully?

Evaluate the following SQL statement:
SELECT product_name || ‘it’s not available for order’ FROM product_information
WHERE product_status = ‘obsolete’;
You received the following error while executing the above query:
ERROR:
ORA-01756: quoted string not properly terminated
What would you do to execute the query successfully?

Evaluate the following SQL statement:
SELECT product_name || ‘it’s not available for order’ FROM product_information
WHERE product_status = ‘obsolete’;

You received the following error while executing the above query:
ERROR:
ORA-01756: quoted string not properly terminated

What would you do to execute the query successfully?

A.
Enclose the character literal string in the SELECT clause within the double quotation marks.

B.
Do not enclose the character literal string in the SELECT clause within the single quotation marks.

C.
Use Quote (q) operator and delimiter to allow the use of single quotation mark in the literal character string.

D.
Use escape character to negate the single quotation mark inside the literal character string in the
SELECT clause.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


user

user

SELECT q’cit’s not available for orderc’ from dual;
SELECT q’!it’s not available for order!’ from dual;
SELECT q’@it’s not available for order!@’ from dual;

Cindy

Cindy

Can anyone explain why C is the right answer?

Re

Re

SELECT last_NAME || ”’s ‘ || ‘ job is ‘ || job_id CATEGORIES FROM empl3 ;

SELECT last_NAME || q’#’s #’ || ‘ job is ‘ || job_id CATEGORIES FROM empl3 ;

SELECT last_NAME || q” || ‘ job is ‘ || job_id CATEGORIES FROM empl3 ;