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')

No comments:

Post a Comment

Please refrain for marketing messages and unnecessary back links.

Workflow errors on New Hire and Add employment instance

User tries to hire a new person or tries to add a new organization relationship encounters a series of error messages related to workflow...

Trending in this Blog this month