Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi...
I am having problems loading the table below. The problem takes place when I add the LOAD part. The query works fine without the load but when the load is added, it gives the ODBC read failed error. I tried changing the field names but nothing is working.
Orders_Tab:
LOAD
date(floor(ORDER_DATE)) AS link_Date,
date(floor(ORDER_DATE)) AS Order_Date, //Load it a second time for making date range selections
ORDER_DATE - yearstart(ORDER_DATE) + 1 AS OrderDayWithinYear,
ORDER_DATE - monthstart(ORDER_DATE) + 1 AS OrderDayWithinYear;
SQL
SELECT trunc(ot.order_date) order_date, qcp.direct_channel channel, decode(qscp.QC_FLASH_SP_TYPE,'Insurance','All Other Home Value Services','Product Warranty','All Other Home Value Services',qscp.QC_FLASH_SP_TYPE) category,ot.oid order_id
FROM orders_tab ot,
qc_cp_master qcp,
qc_report_scp_master qscp
WHERE TRUNC (ot.order_date) BETWEEN TO_DATE ('01/01/2010','MM/DD/YYYY') AND to_date(to_char(sysdate,'MM/DD/YYYY'),'MM/DD/YYYY')
AND ot.entity_oid = qcp.entity_oid
AND ot.order_status > 1
AND qscp.OID = ot.scp_oid ;
I'm not sure why that's happening, but a simple solution would be to split this into 2 table loads. The first would just execute the SQL. The second would use the table from the first (resident) and alias all the field names. That should work unless you have a very large amount of data, because in that case you will see a significant load time increase.
Regards,
Hey Vlad,
Thanks for the response. Actually I had two queries fetching similar data fields which was causing problems. I then changed the field names and the error got resolved. I just figured it out. Sorry for the trouble
Regards
Kumar