Home » SQL & PL/SQL » SQL & PL/SQL » Converting rows into column (9 i)
Converting rows into column [message #307177] Tue, 18 March 2008 01:43 Go to next message
raghuram.sundar
Messages: 11
Registered: February 2008
Location: CHENNAI,INDIA
Junior Member

How will u convert a row in a pl/sql talbe into a column?

i want the headers in a column and the values side by side in a new column

Please anyone having code for achieving this help. we can see this concept in the toad window. on clicking the data grid

Thanks
Raghuram

[Updated on: Tue, 18 March 2008 01:52]

Report message to a moderator

Re: Oracle 9 i [message #307187 is a reply to message #307177] Tue, 18 March 2008 01:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't have TOAD but this is a program feature. (I doubt TOAD does it for a PL/SQL table.)
If TOAD is your program and it can do it then what do you want more?
If it is not then have a look at T. Kyte print_table function.

Precise your need, post an example.

Regards
Michel
Re: Converting rows into column [message #307192 is a reply to message #307177] Tue, 18 March 2008 02:03 Go to previous messageGo to next message
raghuram.sundar
Messages: 11
Registered: February 2008
Location: CHENNAI,INDIA
Junior Member

Thanks for the response. I want it as a view to display in the output and code also of print_table to understand and rework on it to get the needed rows only.
Re: Converting rows into column [message #307197 is a reply to message #307192] Tue, 18 March 2008 02:15 Go to previous messageGo to next message
raghuram.sundar
Messages: 11
Registered: February 2008
Location: CHENNAI,INDIA
Junior Member

Thanks but will this function be run in any user ??? i cant find the code for that function in the given link

Re: Converting rows into column [message #307198 is a reply to message #307197] Tue, 18 March 2008 02:19 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Thanks but will this function be run in any user ???

Yes as soon as you give the execute permission on it.

Quote:
i cant find the code for that function in the given link

Click on the link that is in the page.

Regards
Michel
Re: Converting rows into column [message #307231 is a reply to message #307177] Tue, 18 March 2008 03:45 Go to previous messageGo to next message
raghuram.sundar
Messages: 11
Registered: February 2008
Location: CHENNAI,INDIA
Junior Member

PATIENTID : 23197 23197
VISITID : 16712 16712
VISITINDEX : 1 1
FORMID : 9163 9163
FORMINDEX : 1 1
SECTIONID : 9161 9161
ITEMSETID : 0 0
ITEMSETINDEX : 0 0
ITEMID : 9142 9142
PF_COMMENT : actuel time is not recorded actuel time is notrecorded


please let me know how the above is possible using print_table.currently it is returning as

PATIENTID : 23197
VISITID : 16712
VISITINDEX : 1
FORMID : 7001
FORMINDEX : 1
SECTIONID : 6909
ITEMSETID : 0
ITEMSETINDEX : 0
ITEMID : 6860
PF_COMMENT : equipment not working
-----------------
PATIENTID : 23197
VISITID : 16712
VISITINDEX : 1
FORMID : 9163
FORMINDEX : 1
SECTIONID : 9161
ITEMSETID : 0
ITEMSETINDEX : 0
ITEMID : 9142
PF_COMMENT : actuel time is not recorded
Re: Converting rows into column [message #307234 is a reply to message #307231] Tue, 18 March 2008 03:55 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use stragg or concat_all function in the query you give to print_table. (search for these ones on this site)

Regards
Michel
Previous Topic: how to exclude ',' from character field and convert it into number Field ?
Next Topic: why I can not "create a table " in procedure?
Goto Forum:
  


Current Time: Thu Dec 08 22:33:26 CST 2016

Total time taken to generate the page: 0.08224 seconds