Can we use a select query in embedded sql (Pro*C) as the first argument in a Decode()
function.
Asked
Active
Viewed 4,647 times
0
-
1Are you sure you need to do that? Is there no criteria you can use to join on? – OMG Ponies Dec 31 '09 at 08:46
-
Yes there are criterions however they are too expensive – Sachin Jan 04 '10 at 04:37
1 Answers
1
I'm not sure about embedded sql, but I guess it should work:
SELECT DECODE( ( SELECT 1 FROM dual ), 1, 'Yes', 'No' ) FROM dual
Yes
You need to put the SELECT
in brackets.

Peter Lang
- 54,264
- 27
- 148
- 161
-
I have edited the question, my intention is to use this in ProC (Embedded sql in C) – Sachin Dec 31 '09 at 08:38
-
1
-
There's a lot of modern SQL constructs (eg introduced since 8.0) the precompilers can't use directly. You can use dynamic SQL or hide the SQL in a view. – Gary Myers Jan 03 '10 at 09:59