Using Parameters in Order By Clause in PL - SQL

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Using Parameters in Order By Clause in PL - SQL

Today I was working on a data table, output in HTML generated by PL/SQL
http://joelennon.com/?q=node/583
  • Total Hits: 13911

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 145 votes

  • Category: Oracle/Oracle Misc

  • Submitted on: 2008-04-15 01:56:23

  • Submitted By: Shekhar

  • Set as Favorite

Description:

Basically I have a procedure which takes a parameter (p_sort_by) and establishes which column to sort by based on this parameter. It does this using the DECODE function, which has similar functionality to IF-THEN-ELSE statements. I could have alternatively used CASE statements here, which are easier to understand, but they are not supported in older versions of Oracle.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 37.93%  55
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.34%  15
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.72%  17
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.03%  16
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.97%  42

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements