Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

SQL Load

I am attempting to load in data via a SQL connection. The connection is good and I can load in some queries, however, when I attempt to load in this query, the load is successful, however no data populates.

Is there an error in my script? Seems to get stuck after the 'SELECT' portion.

select

po.created_date, es.last_updated_date, e.event_code,

e.event_date, a.agency_code, bt.buyer_type_code, bt.description buyer_type_desc,

c.channel_code, c.description channel_desc, ps.price_scale_code,

ps.description price_scale_desc, es.price, sec.section_code, s.row_, s.seat_number

from

agency a, buyer_type bt, channel c, event e, event_category ec, event_seat es, order_line_item oli,

patron_order po, price_scale ps, seat s, section sec

where

oli.order_id = po.order_id

and oli.usage_event_id = e.event_id

and es.event_id = e.event_id

and es.order_id = po.order_id

and es.order_line_item_id = oli.order_line_item_id

and po.created_by_agency_id  = a.agency_id

and a.channel_id = c.channel_id

and e.event_category_id = ec.event_category_id

and sec.section_id = es.section_id

and s.seat_id = es.seat_id

and es.buyer_type_id = bt.buyer_type_id

and ps.price_scale_id = es.price_scale_id

and trunc(po.created_date) >= ('01-JAN-2017')

and trunc(po.created_date) <= ('08-APR-2018')

and oli.market_type_code = 'P'

and oli.transaction_type_code in ( 'SA', 'ES', 'CS' )   -- sale, claimsale or exchangesale

and c.channel_code in ( 'BOXOFF', 'INTERNET', 'PHONE' )

and ec.event_category_code = 'HOCKEY'

and e.event_id >= '4461' and e.event_id <= '4502'

13 Replies
tomasz_tru
Specialist
Specialist

It should be "SQL SELECT ..."

evansabres
Specialist
Specialist
Author

I have tried to add this in front of SELECT, however I still get the same result. My other queries do not have SQL in front of the select and they still produce data.

tomasz_tru
Specialist
Specialist

Maybe missing ";" somewhere?

Have you checked this query returns any results in other ODBC client?

Tomasz

vishsaggi
Champion III
Champion III

Does this script give any results when you run in SQL environment i mean Management Studio?

evansabres
Specialist
Specialist
Author

When I run the query in 'Oracle SQL Developer' the query produces the results that I expect.

maxgro
MVP
MVP

if you get an error, please post the error

if the query ends without returning rows, check the filters (where .....)

if the query doesn't end, as you have many tables in the query maybe it's a problem on the database side; you can start with 2 or 3 tables and then add one table at a time or as Tomasz already answered, try with another tool (client)   

vishsaggi
Champion III
Champion III

Hmmm. Nothing seems to be wrong with the script. Can you try like running only this script. I mean just use your ODBC connection string and just run this single script.

ODBC CONNECT32 to ......;

LOAD *;

SQL SELECT ......yourSQLscriptHere;

evansabres
Specialist
Specialist
Author

When I run the query, I do not get an error message, but the re-load script indicates '0 Lines fetched'

evansabres
Specialist
Specialist
Author

When I run the query, I do not get an error message, but the re-load script indicates '0 Lines fetched'