When creating objects that are global, make sure that they do not depend on objects that are local.
This example creates a global object with a dependency on a local object. Assume that you create the lineitem temporary table on a secondary node:
DECLARE LOCAL TEMPORARY TABLE #lineitem ( l_orderkey integer, l_partkey integer iq unique(20000000), l_suppkey integer iq unique(20000000), l_linenumber integer, l_quantity integer iq unique(50), l_extendedprice double, l_discount double iq unique(11), l_tax double iq unique(9), l_returnflag char(1) iq unique(3), l_linestatus char(1) iq unique(2), l_shipdate date iq unique(270), l_commitdate date iq unique(256), l_receiptdate date iq unique(300), l_shipinstruct char(25), l_shipmode char(10) iq unique(7), l_comment char(44) )
Next, you create indexes—which are global objects—on the columns of the lineitem temporary table using the BEGIN PARALLEL IQ command:
BEGIN PARALLEL IQ CREATE LF INDEX LFIQ_IDX_TXXX_CXX_L_PK on #lineitem (l_partkey); CREATE LF INDEX LFIQ_IDX_TXXX_CXX_L_OK on #lineitem (l_orderkey); END PARALLEL IQ
SAP Sybase IQ returns the error Table 'lineitem' not found because the BEGIN PARALLEL IQ command is a global command sent to the coordinator node, but the lineitem table is a local temporary table on the secondary node.