Solved

oracle pivot column names with embeddded spaces

Posted on 2011-09-27
2
865 Views
Last Modified: 2012-06-22
I am pivoting an oracle view on a certain column. The values in this column may contain embedded spaces. I can get the column names to pivot ok if I surround them with single quotes, however, they then appear in the result with the quotes! Is there any way to get the pivoted column values/names to appear without the quotes? Assume it would not be possible to change the values in the pivoted column to eliminate the blanks.

I have attached a screen image that shows what I mean. pivot table
0
Comment
Question by:bassman592
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 36710347
for metric in ('PATS' as "PATS", 'PATS Ratio' as "PATS Ratio", 'TRX' as "TRX", 'TRX Ratio' as "TRX Ratio")
0
 

Author Closing Comment

by:bassman592
ID: 36710411
Beautiful! Thank you.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to recover a database from a user managed backup

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now