Ive been tasked to write a simple php+oracle web reprting tool and I happen to have chanced a pretty complex query that perfectly works in SQL Developer:
SELECT 'LASTNAME, FIRSTNAME, STATUS' from dual;
with user as
(
...
..
..
..
(very long query)
and then it gives me this:
PHP Warning: oci_execute(): ORA-00911: invalid character
based on my initial investigation, it looks like PHP complains about the ';' after first line (where it says select from ... dual ;)
On the PHP side, it looks like this:
$stid = oci_parse($conn, $query);
oci_execute($stid);
where $query is the very long query:
$query = "SELECT 'LASTNAME, FIRSTNAME, STATUS' from dual;
with user as
(
...
..
..
..
I want to know if there is a way to rewrite the entire query without using the 'dual' part?