Home » SQL & PL/SQL » SQL & PL/SQL » Is there a reverse method?
Is there a reverse method? [message #257058] Tue, 07 August 2007 08:45 Go to next message
ronin10
Messages: 17
Registered: July 2007
Junior Member
Is there a reverse method in PLSQL that will reverse the order of the elements in a array? If so, what is it? I am new to PL/SQL and only have a reference book that is not very helpful.

Thanks in advance.
Cool
Re: Is there a reverse method? [message #257071 is a reply to message #257058] Tue, 07 August 2007 09:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Afaik, there is none, you have to build yours.

Regards
Michel
Re: Is there a reverse method? [message #257080 is a reply to message #257071] Tue, 07 August 2007 09:31 Go to previous messageGo to next message
ronin10
Messages: 17
Registered: July 2007
Junior Member
thanks
Re: Is there a reverse method? [message #257297 is a reply to message #257080] Wed, 08 August 2007 01:11 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
I am puzzled. What is it exactly that you're after? Can you post a small example to illustrate?

MHE
Re: Is there a reverse method? [message #258883 is a reply to message #257297] Mon, 13 August 2007 13:18 Go to previous messageGo to next message
ronin10
Messages: 17
Registered: July 2007
Junior Member
i have a string of numbers/or data entered by user say 1234567890
and depending on condition i need to reverse the numbers to 0987654321

i just thought that there would be a reverse method that i could use.

thanks.
Re: Is there a reverse method? [message #258885 is a reply to message #257058] Mon, 13 August 2007 13:20 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
What is the business/functional need to reverse the order of entry ? If you share that, perhaps there might be another way to accomplish the goal.
Re: Is there a reverse method? [message #258899 is a reply to message #257058] Mon, 13 August 2007 14:30 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
There sure is and it is call REVERSE.


select reverse('1234567890') from dual;

REVERSE('1
----------
0987654321
Re: Is there a reverse method? [message #258903 is a reply to message #257058] Mon, 13 August 2007 14:44 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Wow .. Just when I thought I knew most of the undocumented
built-ins.



Nice find Bill

[Updated on: Mon, 13 August 2007 14:47]

Report message to a moderator

Re: Is there a reverse method? [message #258907 is a reply to message #258903] Mon, 13 August 2007 14:58 Go to previous message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This function exists still at least version 6.
Internally it is used for reverse index.

Regards
Michel
Previous Topic: to recompile java objects
Next Topic: Why is TRIGGER "not firing"?
Goto Forum:
  


Current Time: Thu Dec 12 23:46:26 CST 2024