Home » SQL & PL/SQL » SQL & PL/SQL » function
icon9.gif  function [message #248778] Sun, 01 July 2007 23:55 Go to next message
Messages: 11
Registered: June 2007
Location: hyd
Junior Member

Hi all,
The given example from sqlbase:
@CHOOSE (selector number, value 0, value 1, ..., value n)

This function selects a value from a list based on a correlation between the selector-number and the sequence number of a value in the list.
You must specify a selector-number and at least one value. A negative selector-number maps to the first value in the list (value 0). If the selector number exceeds the number of values in the list, the result is the last value in the list. Every value in the list is cast to the data type of the first value (value 0).


@CHOOSE(SEL_NUM, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’)

number Values
0 A
-1 A
2 C
12 G

For this what function i can use in oracle 10g.
Thanks in advance.
Re: function [message #248807 is a reply to message #248778] Mon, 02 July 2007 01:44 Go to previous message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to create yours with CASE.

Previous Topic: nested cursor by table_name as parameter
Next Topic: wrap error in oracle 9i not in 10g
Goto Forum:

Current Time: Fri Jul 28 14:24:12 CDT 2017

Total time taken to generate the page: 0.40012 seconds