Can we use a select query in embedded sql (pro C) as the first argument in Decode() function.
+1
A:
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
2009-12-31 08:35:29
I have edited the question, my intention is to use this in ProC (Embedded sql in C)
Sachin Chourasiya
2009-12-31 08:38:25
What happens when you try that?
Tony Andrews
2009-12-31 10:09:02
I am getting compilation errors
Sachin Chourasiya
2010-01-03 09:24:29
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
2010-01-03 09:59:14