Home » RDBMS Server » Server Administration » How to implement Decode Function in java
How to implement Decode Function in java [message #373604] Thu, 26 April 2001 01:23 Go to next message
Anand Kumar
Messages: 2
Registered: April 2001
Junior Member
Hello,
We are migrating from Oracle to MSSQL Server. Now
we want to permanently remove Deocde Function and replace with java equivalent Code.

Its very urgent any one can help me??
Re: How to implement Decode Function in java [message #373614 is a reply to message #373604] Thu, 26 April 2001 12:44 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
As you know the decode is nothing more than a "if - then - else".

select Decode (my_val, 1, 'One', 2, 'Two', 'Other') from dual;

i.e.
if my_val = 1
then 'One'
elsif my_val = 2
then 'Two'
else 'Other'

Transforming a Resultset for Presentation purposes may be easy to resolve. However, when you have decodes the the where clause it will probably need SQL re-coding.
Previous Topic: Re: serial number in SQL reports
Next Topic: Sort
Goto Forum:
  


Current Time: Tue Jul 02 17:33:47 CDT 2024