Tried to make a NESTED Join within the SQL of a GRID APPLICATION. The query works fine in the SQL Builder in scriptcase and with SqlPro (desktop application). Here is the query.
SELECT a.iniid,
a.cuiid,
a.cuiid,
c.wosLetter,
a.insDescription,
a.sriid,
a.indDateOfOrder,
a.indDateOrderDue,
a.inbRushOrder
FROM invoice a LEFT OUTER JOIN (workorder c INNER JOIN workflow d ON c.woiid = d.woiid)
ON a.iniid = c.iniid
WHERE d.wfiManagement = '2' OR d.wfiManagement = '1' AND a.loiid = 2
Compile and Run application:
Fatal error: Call to a member function MoveNext() on a non-object in /usr/local/zend/apache2/htdocs/scriptcase6/devel/lib/php/database.inc.php on line 882
Sometimes lets me compile the application but when it loads and runs:
Error while accessing the database:
Column ‘iniid’ in field list is ambiguous
SelectLimit(SELECT iniid, cuiid, cuiid as cuiid_1, insDescription, sriid, indDateOfOrder, indDateOrderDue, inbRushOrder from invoice a LEFT OUTER JOIN (workorder c INNER JOIN workflow d ON c.woiid = d.woiid) ON a.iniid = c.iniid where (d.wfiManagement = ‘2’) OR (d.wfiManagement = ‘1’) AND (a.loiid = 2), 22, 0)
Thoughts as to why it will work in the SQL builder (scriptcase tool) and within my SQLPRO application. I would believe this to be in error within SCRIPTCASE not being able to use a NESTED SQL.
Kris