Home » SQL & PL/SQL » SQL & PL/SQL » Ternary Operator in PL/SQL (Oracle 10g on UNIX)
Ternary Operator in PL/SQL [message #343180] Tue, 26 August 2008 09:44 Go to next message
soham.desai@gmail.com
Messages: 21
Registered: August 2008
Junior Member
I know that there is NO ternary operator in PL/SQL.

Does anybody has an idea how to simulte in PL/SQL?

Thanks
Re: Ternary Operator in PL/SQL [message #343189 is a reply to message #343180] Tue, 26 August 2008 10:08 Go to previous messageGo to next message
jramya
Messages: 42
Registered: April 2008
Member
Hi Soham,
We can do this using CASE statements in PLSQl
Ternary operation (a>b)?a:b says if a is greater than b return a or b
In PLSQL
select
(case when sysdate>'20-Aug-2008' then 'YES' else 'NO' end)result from dual
will result in 'YES'.
Regards
Ramya
Re: Ternary Operator in PL/SQL [message #343191 is a reply to message #343180] Tue, 26 August 2008 10:13 Go to previous message
soham.desai@gmail.com
Messages: 21
Registered: August 2008
Junior Member
Thanks Ramya.

This round about trick should be enough for me.

Thanks
Previous Topic: Different between TRUNC AND ROUND FUNCTION?
Next Topic: Reg accessing one user's object from other users with read only option
Goto Forum:
  


Current Time: Thu Dec 08 16:06:23 CST 2016

Total time taken to generate the page: 0.17321 seconds