Home » SQL & PL/SQL » SQL & PL/SQL » Create column format of a single row to use as saperate cursor elements
icon1.gif  Create column format of a single row to use as saperate cursor elements [message #254984] Mon, 30 July 2007 05:50 Go to next message
kshitij.raj
Messages: 7
Registered: July 2007
Junior Member
Table structure
create table INTEREST_SCHEMES
(
ISC_SCHEME_ID NUMBER(5) not null,
ISC_SLAB1_TO_DAYS NUMBER(12),
ISC_SLAB1_RATE NUMBER(12,2),
ISC_SLAB1_MIN_AMT NUMBER(12),
ISC_SLAB2_TO_DAYS NUMBER(12),
ISC_SLAB2_RATE NUMBER(12,2),
ISC_SLAB2_MIN_AMT NUMBER(12),
ISC_SLAB3_TO_DAYS NUMBER(12),
ISC_SLAB3_RATE NUMBER(12,2),
ISC_SLAB3_MIN_AMT NUMBER(12),
ISC_SLAB4_TO_DAYS NUMBER(12),
ISC_SLAB4_RATE NUMBER(12,2),
ISC_SLAB4_MIN_AMT NUMBER(12),
ISC_SLAB5_TO_DAYS NUMBER(12),
ISC_SLAB5_RATE NUMBER(12,2),
ISC_SLAB5_MIN_AMT NUMBER(12),
ISC_SLAB6_TO_DAYS NUMBER(12),
ISC_SLAB6_RATE NUMBER(12,2),
ISC_SLAB6_MIN_AMT NUMBER(12)
)

I want the output as :

output set as (ISC_SCHEME_ID ,
ISC_SLAB_TO_DAYS ,
ISC_SLAB_RATE ,
ISC_SLAB_MIN_AMT)
with six rows,where ISC_SCHEME_ID is my Primary Key.

I cannot use six unions.

I tried with CONNET/PRIOR TO but i think there is some flaw regarding the linkage of ranks as all are on the same rank.

Anybody any solution please Revert..Thanks Smile
Re: Create column format of a single row to use as saperate cursor elements [message #254987 is a reply to message #254984] Mon, 30 July 2007 06:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> with lines as (select level line from dual connect by level <= 6),
  2       data as (select 'a' col1, 'b' col2, 'c' col3, 'd' col4, 'e' col5, 'f' col6 from dual)
  3  select decode(line,1,col1,2,col2,3,col3,4,col4,5,col5,6,col6) col
  4  from data, lines
  5  /
C
-
a
b
c
d
e
f

6 rows selected.


Btw,
Please read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Regards
Michel

[Updated on: Mon, 30 July 2007 06:18]

Report message to a moderator

Re: Create column format of a single row to use as saperate cursor elements [message #255014 is a reply to message #254987] Mon, 30 July 2007 07:33 Go to previous message
kshitij.raj
Messages: 7
Registered: July 2007
Junior Member
THanks Michel,

It worked fine.And I would surely go through the links suggested by you.

Thanks and Regards,

Kshitij
Previous Topic: spawning multiple processes
Next Topic: Query : compilation of invalid objects during execution
Goto Forum:
  


Current Time: Thu Dec 08 12:29:24 CST 2016

Total time taken to generate the page: 0.28784 seconds