Select column at runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilikesuresh
    New Member
    • Aug 2007
    • 47

    Select column at runtime

    hi
    i have a table (table_Days)tha t contains columns
    d0 d1 d2 d3 ............... d30

    based on my result i want to either select d0 or d1 or d3 ....d30 at runtime and get the respected value on that column
    plz any one can help me out!!!!!!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    that can be eaily done by writing a simple PL/SQL block.

    Comment

    • nramrits
      New Member
      • Sep 2007
      • 18

      #3
      Originally posted by ilikesuresh
      hi
      i have a table (table_Days)tha t contains columns
      d0 d1 d2 d3 ............... d30

      based on my result i want to either select d0 or d1 or d3 ....d30 at runtime and get the respected value on that column
      plz any one can help me out!!!!!!
      select * from table_days where &column_name=&a rgument

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        You can accomplish this task easily by using a Simple PLSQL block or using a DECODE, CASE statement in the SQL query itself.

        Comment

        • ilikesuresh
          New Member
          • Aug 2007
          • 47

          #5
          Originally posted by amitpatel66
          You can accomplish this task easily by using a Simple PLSQL block or using a DECODE, CASE statement in the SQL query itself.
          Thanks for your guidelines

          Comment

          Working...