Local storage connection error

When attempting to add an output or cleanse, an error is returned "Build and execute a SQL query before adding a new step". This occurs when merging the output of 4 other workflows into a local storage connection.

I need to know how. what to do in regards to the statement.

Thanks
Toad 6.2

Can't reproduce, at least not with my simple queries and I'm on TDP 6.3.

Can you share your combined query in Workflow 5? Are you seeing the same thing when you upgrade to TDP 6.3?

This is a union all query…

SELECT _14881R25-rq.KEY,

_14881R25-WO&SC.KEY,

_14881R25-QO.KEY,

_14881R25-po.STOCK_CODE,

_14881R25-WO&SC.STOCK_CODE,

_14881R25-QO.STOCK_CODE,

_14881R25-rq.STOCK_CODE,

_14881R25-WO&SC.DESCR,

_14881R25-WO&SC.LEAD_TIME,

_14881R25-WO&SC.SPECIALIST,

_14881R25-WO&SC.PL,

_14881R25-WO&SC.DOCITM,

_14881R25-po.POITM,

_14881R25-QO.DOCITM,

_14881R25-po.PO_STATUS,

_14881R25-rq.STATUS,

_14881R25-QO.STATUS,

_14881R25-WO&SC.STATUS,

_14881R25-rq.DOCITM,

_14881R25-WO&SC.WKWK,

_14881R25-WO&SC.PROJ_START,

_14881R25-rq.REQUIRED_DATE,

_14881R25-po.PROMISE_DATE,

_14881R25-QO.REQUIRED_DATE,

_14881R25-rq.ATTACH,

_14881R25-QO.ATTACH,

_14881R25-po.ATTACH,

_14881R25-WO&SC.REPORT_GROUP,

_14881R25-rq.PROCUREMENT_LEVEL,

_14881R25-QO.PL,

_14881R25-po.PL,

_14881R25-WO&SC.QTY,

_14881R25-QO.QTY,

_14881R25-rq.QTY,

_14881R25-po.QTY,

_14881R25-po.IN_RCPT,

_14881R25-rq.BUYER,

_14881R25-QO.BUYER,

_14881R25-po.BUYER,

_14881R25-WO&SC.ALLOCQTY,

_14881R25-WO&SC.PART_STATUS,

_14881R25-WO&SC.WOSTSAT,

_14881R25-WO&SC.PROJ_START_DATE,

_14881R25-po.KEY

FROM 14881r25.14881R25-WO&SC _14881R25-WO&SC,

14881r25.14881R25-QO _14881R25-QO,

14881r25.14881R25-rq _14881R25-rq,

14881r25.14881R25-po _14881R25-po

And here is the layout

The query you posted is not a UNION ALL query, FYI.
Queries involving the UNION ALL operator should be in the form of

    SELECT columns FROM table1
    UNION ALL
    SELECT columns FROM table2
    UNION ALL
    . . .
    SELECT columns FROM tableN;

It appears that you dragged all four tables into the UNION ALL subnode of your query structure. So TDP created a cartesian product of the four tables you placed into the UNION ALL subnode, Not what you want, and almost certainly not the same columns (and order) that you chose in the table/s you placed in your main query to start with. Whatever tables or queries you're UNIONing have to specify the same columns and in the same order.

In general, the idea is to drag your first of N tables to be UNION'd into your initial query builder palette, then add additional UNION ALL subnodes to your query tree to include your other three tables: one table per subnode. Follow the screen snap guidance below. Hope this helps for now.

Awesome, this worked beautifully.

1 Like