Solved

Using Oracle 11g functions in Microsoft Query Wizard in Excel 2010

Posted on 2013-06-11
5
653 Views
Last Modified: 2013-07-01
I'm trying to use the Oracle pipelined table() function in the microsoft query wizard but I'm getting the error, "Could not add the table..."

My query looks like this inside the Sql Statement prompt in the Microsoft query wizard:
Select * from table(MyData.SomeTable_Test('03/28/2013'));

Does the Oracle table function work in microsoft query wizard?  Some other Oracle functions like to_date works.

Thanks, PI
0
Comment
Question by:parnassusinvest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39240083
mmmm, never used the ms query wizard, but there is a massive difference between an inbuilt language level scalar function like to_date and a user defined (pipelined?) table function. About the only thing in common is that the word function occurs when describing both, that does not make them equal.

Calling the table function most probably requires a schema owner prefix e.g.

select * from table(schemaowner.someTableFcn(....

so if 'MyData' in your example is the schema owner then that bit should be ok

Also table functions require "strongly typed" parameters, so if that '03/28/2013' is intended to be a date then make it into a date (as it stands it is a string of near meaningless 8 digits plus 2 separators)

select * from table(schemaowner.someTableFcn(to_date('2013-03-28','yyyy-mm-dd'));

might work

for more details on table functions

ps: <10% of the world uses mm/dd/yyyy as their typical date sequence, please don't assume software will immediately understand it.
0
 

Accepted Solution

by:
parnassusinvest earned 0 total points
ID: 39279129
Unfortunately, using to_date() did not work.  However, I was able to install the Power Pivot Excel Plugin and I was able to use Select * from table(MyData.SomeTable_Test('03/28/2013'))  The good news is that the pipelined table() function works through power pivot, but the bad news is that now I can't figure out how to make the date a parameter. Almost there...
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39279898
>>table functions require "strongly typed" parameters

try this:

select * from table(MyData.SomeTable_Test(  (select to_date('03/28/2013','mm/dd/yyyy') from dual)  )) 

Open in new window

0
 

Author Closing Comment

by:parnassusinvest
ID: 39289423
It works but it's not perfect
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39289484
I would like to remind you that MM/DD/YYYY is NOT a universal standard

(in fact it is relatively rare, mostly used only in North America, ~<10% of the world pop)

'2013-03-28' may be better
it's possible that simply changing to YYYY-MM-DD will help.

(please) drop any preconceived notions about the "format" of dates

As you probably know, even in excel, a number can be formatted to date. Databases have their own special requirements regarding dates too. This is especially true of table functions in Oracle which require "strongly typed" parameters in my experience.

best of luck with this, Cheers, Paul.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Format underline a range 2 101
Excel Formula return each instance from list 2 82
Microsoft Access 2010 Question 2 92
SQL 2016 licensing 6 68
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

710 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