Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extraction of Dynamic output to a local table

Status
Not open for further replies.

fibonaccii

Technical User
Sep 5, 2007
14
CA
I am looking for a way to assign a Dynamic Output queried from a select statement with multiple rows into a Local table.

SELECT rownum, Amount, Due_date
FROM TABLE.DBlink
where ROLL_NO = 'xyz'
and (extract(year from due_Date)) = EXTRACT(YEAR FROM sysdate)
and SUBSTR(ORIGIN,1,3) in ('FTX','ITX','STX')
order by due_date;

FOR EX: Output Observed; Looking at multiple output instead of single Row.

AMOUNT DATE

1027 01-MAR-07
1026.68 01-MAY-07
1087 03-JUL-07
1086.12 04-SEP-07

Insertion into Table

Rownumber Amount Date

1 1027 01-MAR-07
2 1026.68 01-MAY-07
3 1087 03-JUL-07
4 1086.12 04-SEP-07

Looking for a quick response. Thanx in Advance.


 
Fibonaccii,

Are you asking for the following:
Code:
[b]create table fibonaccii as[/b]
SELECT rownum [b]rn[/b], Amount, Due_date  
FROM TABLE.DBlink 
where ROLL_NO = 'xyz' 
and (extract(year from due_Date)) = EXTRACT(YEAR FROM sysdate) 
and SUBSTR(ORIGIN,1,3) in ('FTX','ITX','STX')
order by due_date;
Let us know how this differs from what you wanted.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Thanx Mufasa,

Thats exactly what I was looking for.

I have another question Under the subject line " using For Loop to attain single string from multiple rows"

Please look into that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top