Home » SQL & PL/SQL » SQL & PL/SQL » function
icon9.gif  function [message #248778] Sun, 01 July 2007 23:55 Go to next message
logina
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).

Example

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

Selector
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: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
None.
You have to create yours with CASE.

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


Current Time: Sat Dec 03 05:47:32 CST 2016

Total time taken to generate the page: 0.05952 seconds