Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle View (for Excel)

932932Apr 24 2012 — edited Apr 25 2012
Hello people,

Im using Oracle XE11g and Excel 2007. I've created a View in SQL Developer which selects fields from multiple tables. The intention is to allow Excel to import this View using ODBC. The problem is that the view isn't giving the data the way I want it in Excel

If I use my created view into Excel I get something like this:

personname - testname - time - objectname - result - date
Edward - RunningTest - 15:22:01 - Speed (km/h) - 12 - 24-04-2012
Edward - RunningTest - 15:22:01 - Heart Rate - 98 - 24-04-2012
Edward - RunningTest - 15:22:01 - Power - 50 - 24-04-2012
Edward - RunningTest - 15:22:02 - Speed (km/h) - 13 - 24-04-2012
Edward - RunningTest - 15:22:02 - Heart Rate - 99 - 24-04-2012
Edward - RunningTest - 15:22:02 - Power - 12 - 24-04-2012
Edward - RunningTest - 15:22:03 - Speed (km/h) - 12 - 24-04-2012
Edward - RunningTest - 15:22:03 - Heart Rate - 100 - 24-04-2012
Edward - RunningTest - 15:22:03 - Power - 12 - 24-04-2012

And this is the query of the view I use:

select psn.naam personname
, tst.name testname
, tms.seconds time
, obj.name objectname
, trt.result result
, dtm.days date
from persons psn
, results rst
, times tms
, tests tst
, objects obj
, dates dts
where psn.id=trt.persons_id
and obj.id=trt.objects_id
and obj.tests_id=tst.id
and trt.date_id=dts.id
and rst.times_id=tms.id
and tst.name='RunningTest'

Please note that the query is translated into English fieldnames so there might be some errors in it.

The way I'd like to have the data represented in Excel is like this:

Personname
Edward

Date
24-04-2012

Time - Speed (km/h) - Heart Rate - Power
15:22:01 - 12 - 98 - 50
15:22:02 - 13 - 99 - 52
15:22:03 - 12 - 100 - 51
etc------------
etc -----------

Is there any way to build the view so it shows the data like above?
Any help is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2012
Added on Apr 24 2012
4 comments
262 views