0

I have a variable called ERROR_DETAIL and inside my file file.sql I have this line:

SELECT 'error detail : &ERROR_DETAIL ' FROM DUAL;

Once executed sqlplus complains with the following error when the variable ERROR_DETAIL contains for example 'the field x.y is mandatory':

ORA-00923: FROM keyword not found where expected

I know about the issue with x.y (treated as table.column).

I tried to use double quotes, but I get an invalid identifier error

Also I can't set define off.

This is the error I receive with the script I have:

Error message in script

0
0
SQL> SELECT 'error detail : ' || &ERROR_DETAIL from dual;
Enter value for error_detail: 'the field x.y is mandatory'
old   1: SELECT 'error detail : ' || &ERROR_DETAIL from dual
new   1: SELECT 'error detail : ' || 'the field x.y is mandatory'  from dual

'ERRORDETAIL:'||'THEFIELDX.YISMANDATORY'
-----------------------------------------
error detail : the field x.y is mandatory

SQL>
0
0
SELECT q'{error detail : &ERROR_DETAIL }' FROM DUAL;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.