LOV

Trying this conditional query, but getting an error that it should start from 'select'. How am I supposed to use conditions?

有帮助吗?

解决方案

You could use a conditional concatenated query:

SELECT name display, name return_value
  FROM ns1
 WHERE "type" = :P5_REC_TYPE_ID
   AND :P5_NS_ID IS NULL
UNION ALL
SELECT name display, name return_value
  FROM ns2
 WHERE "type" = :P5_REC_TYPE_ID
   AND :P5_NS_ID IS NOT NULL

Replace IS NULL/IS NOT NULL with the appropriate logical test.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top