Home » Developer & Programmer » Precompilers, OCI & OCCI » SQL CASE Statement in ProC (Oracle 10g2, Solaris)
SQL CASE Statement in ProC [message #481049] Fri, 29 October 2010 12:40 Go to next message
mjm22
Messages: 54
Registered: January 2010
Location: Singapore
Member
Hi,

I think I know the answer to this as I have come across similar issues in ProC where standard PL/SQL syntax does not work correctly when run in an EXEC SQL block.

Basically I have a cursor declared and then do a batch fetch. It is quite a large bit of SQL so I won't complicate this post by including it here.

The Cursor SQL has a CASE statement in the select that determines a generated END DTM column as a calculation on the start DTM, depending on another returned column (i.e. End DTM is Either START DTM + 2 hours or START DTM + 5 hours, etc).

However, If I run the cursor PL/SQL via Toad, SQL*PLUS, etc I get the required results. If I run the Pro*C code (against the same data), the ELSE option of the CASE command is always implemented and the values are incorrect.

Like I say, I think that this is because the CASE statement isn't supported correctly in Pro*C but I just thought I would check on here to confirm. If that is the case then I guess I will have to recode using a DECODE.
Re: SQL CASE Statement in ProC [message #481050 is a reply to message #481049] Fri, 29 October 2010 12:50 Go to previous message
Michel Cadot
Messages: 68201
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is supported.

Regards
Michel

[Updated on: Fri, 29 October 2010 12:50]

Report message to a moderator

Previous Topic: Convert compile 'o' files to C code
Next Topic: Pro*C, dbx and check access
Goto Forum:
  


Current Time: Sat Jun 25 03:06:10 CDT 2022