Parameter Query in Excel ODBC

Database
Enthusiast

Parameter Query in Excel ODBC

Hi all,

select calendar_date,
sum(Sales_Value) as Daily_Sales_Value
from DAILY_SALES
where calendar_date >= date-3
group by 1

Above Query I am using in Excel via ODBC connection and its working perfect and give me a result in second.

Now I want to try to do Parameter query using ? (Quesation Mark) like below

select calendar_date,
sum(Sales_Value) as Daily_Sales_Value
from DAILY_SALES
where calendar_date >= date-Cast(? as integer)
group by 1

It's working but take to much time (more than 10 minutes).

Is am I doing anything wrong? please help.

Thanks
Vinay

3 REPLIES
Enthusiast

Re: Parameter Query in Excel ODBC

Hi Vinay,

I am not understanding correctly. What you are trying to acheive by giving parameter query string? Above syntax is not working correctly for me.

Enthusiast

Re: Parameter Query in Excel ODBC

Hi,

This Teradata query to be run in Excel using ODBC Connection. (I Hope you have create connection)

you have to copy this query into Excel

Data>>Connection>>Properties>>Defination>>Command Text

Once you click ok i will generate the result.

But As i said when I use Parameter then it takes too long to produce result. Why?

Vinay

Enthusiast

Parameter Query in Excel ODBC

Hi,

Can someone help me? 

I am trying to pass multiple SKUs through ODBC with no luck, I can use cast (? As integer) to pass one UPC

I can put UPC’s in SQL statement but I would like to use parameter to grab all UPC’s from single cell

(2113035761,2113515774,21283100000,21233900000)

 

 

Please help

2Z