UNLOAD query involves ORDER-BY returns ERORR[4001].

Bug #1392481 reported by Julie Thai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
Medium
khaled Bouaziz

Bug Description

Currently TRAF does not support order-by clause in UNLOAD stmt.
Appropriate error msg to be returned.

SQL>unload with purgedata from target
into '/bulkload/QA_unload_tests/loc_queries' select
        l_orderkey,
        cast(sum(l_extendedprice*(1-l_discount)) as numeric(18,2)) as revenue,
        o_orderdate,
        o_shippriority
from
        g_tpch2x.customer,
        g_tpch2x.orders,
        g_tpch2x.lineitem
where
        c_mktsegment = 'HOUSEHOLD'
        and c_custkey = o_custkey
        and l_orderkey = o_orderkey
        and o_orderdate < date '1995-03-12'
        and l_shipdate > date '1995-03-12'
group by
        l_orderkey,
        o_orderdate,
        o_shippriority
order by
        revenue desc,
        o_orderdate;
*** ERROR[4001] Column REVENUE is not found. Tables in scope: TRAFODION.BULKLOAD_UNLOAD.EXE_UTIL_EXPR__. Default schema: TRAFODION.BULKLOAD_UNLOAD. [2014-11-12 17:46:20]

Tags: sql-exe
Revision history for this message
khaled Bouaziz (khaled-bouaziz) wrote :

Currently order by clause is not supported with bulk unload. and a syntax error will be produced when used order by is used.
this issue is addressed by the same changes made in the parser to address bug
1398981
unload with union query fails with ERROR[4066]

Changed in trafodion:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.