Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

SQL error

Hi,

I have the below SQL and I am getting a Script Error stating that the ODBC read failed.


Is there something obvious I am missing?

Any help will be much appreciated.

Regards,

Daniel

//-- _p_office          - office

//-- _p_desk          - desk

//-- _p_lob          - lob

//-- _p_portfolio      - portfolio

//-- _p_book          - book

//-- _p_strategy      - strategy

//-- _p_date_type      - date type --> values: Trade Dt, Create Dt

//-- _p_date1          - date From 'yyyy/mm/dd'

//-- _p_date2          - date To 'yyyy/mm/dd'

//-- _p_internal      - internal or external --> values: 'External','Internal' or '%' for all

//-- _p_trade_type      - trade type --> values belo

//-- _p_compute_dt - computation date for Exposure and PricePL

//-- _p_compute_type - computation mode --> values 'Trade', 'Exposure','PricePL'

//-- _p_trade_num - for single trade selection, 0 for all trades

ODBC CONNECT32 TO [IQ DEV];
//-------- Start Multiple Select Statements ------
select *
from
tempest_tier1.p_edw_trade_pos('Non-US','LPG','%','%','%','%','Trade Dt','2014/01/01',today(),'%','%',today(),'Trade',0) pos
inner join tempest_tier1.v_dw_dim_strategy_un str  on (str.strategy_num=pos.strategy_num)
//-------- End Multiple Select Statements ------

8 Replies
Not applicable

Hi,

odbc connect32 to then next you need to provide the username and passwords.

and you need to check whether the database is 32 bit or 64 bit

agomes1971
Specialist II
Specialist II

Hi,

I think you're working on a mix mode environment. What is your OS (32 or 64 bit)?

And your oledb or odbc drivers?

Make this analysis...

Regards

André Gomes

danielnevitt
Creator
Creator
Author

Thanks for the replies.

The below works fine, however when I try to add the inner join, I get the error message.

select * from tempest_tier1.p_edw_trade_pos('Non-US','LPG','%','%','%','%','Trade Dt','2000/01/01','2050/01/01','%','%',today(),'Exposure',0)


Regards,

Daniel

agomes1971
Specialist II
Specialist II

Hi,

does this sql statement with the join works on sql?

Regards

André Gomes

danielnevitt
Creator
Creator
Author

Hi Andre

Yes the statement works with the join on sql.

Regards,

Daniel

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Daniel,

would I be right that p_edw_trade_pos is a stored procedure? If so, it's not possible to inner join to a stored procedure result set directly in SQL. I'd suggest splitting it out into two queries, one for the stored proc, and one for the table, and do the inner join in QlikView instead.

Marcus

danielnevitt
Creator
Creator
Author

Hi Marcus,

The p_edw_trade_pos is a stored procedure.  Are you able to send an example of how I should split into two queries?

Thanks,

Daniel

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Try something like this:

ResultSet:

LOAD *;

SQL SELECT * FROM [your first stored procedure call];

INNER JOIN (ResultSet)

LOAD *;

SQL SELECT * FROM [your second stored procedure call];