Running multiple SQL Plus queries in PHP?
jtp51May 17 2004 — edited May 23 2004SUMMARY:
I have a query that consists of multiple SQL statements that will work when I run them all together in SQL Plus.
ISSUE:
When I split them up, running each part seperately, I do not receive any results. However, if I leave in the semi-colon when trying to run them together in one large SQL query, I receive parsing and execution errors in PHP.
QUERY:
CREATE GLOBAL TEMPORARY TABLE tmp0074661 (groupid varchar2(8));
insert into tmp0074661 (SELECT distinct groupid from TAB_COLOR_PRODUCT
WHERE PRODUCTID in (select GROUPID from tab_color_subgroup where subnum = '0074661' and unitnum = '001')
and GROUPID LIKE '06%');
select a.segment, b.description, a.menu_pos, a.seg_order
from tab_color_segment a, tab_color_defs b
where b.id = a.segment and a.segment in ((SELECT groupid from tmp0074661)
MINUS
select distinct b.pagembr from tab_color_lpn a, tab_color_pagembr b where
a.segment in (select groupid from tmp0074661)
and b.lpn = a.lpn
and b.pgmbr_order = '001'
and b.pagembr in (select groupid from tmp0074661)
)
order by menu_pos, seg_order;
QUESTION
How can I run this statement in PHP?