How to use FROM clause in a expression in a PS-Query?
An expression in a PS-Query will never allow a FROM clause to be specified. In case, a FROM is specified, an error will be issued as "FROM clauses are not allowed in expressions".
For example if the below statement is tried in a PS-Query expression, it will error out:
Decode(A.TRANS_METHOD, 'F','FROM','T','TO')
So how to pass Oracle reserved keywords in an expression? The best way is to use concat operator and trick the system.
The above statement can be rewritten as below:
Decode(A.TRANS_METHOD, 'F',('F'||'ROM'),'T','TO')
For example if the below statement is tried in a PS-Query expression, it will error out:
Decode(A.TRANS_METHOD, 'F','FROM','T','TO')
So how to pass Oracle reserved keywords in an expression? The best way is to use concat operator and trick the system.
The above statement can be rewritten as below:
Decode(A.TRANS_METHOD, 'F',('F'||'ROM'),'T','TO')
No comments
Please refrain for marketing messages and unnecessary back links.