Using the term PIVOT or UNPIVOT as an alias in a procedure gives a syntax error when trying to run in Toad.
"ERROR line 4679, col 95, ending_line 4679, ending_col 95, Found ',', Expecting: XML -or- ("
This is only a problem in some situations. Example:
--This Works:
SELECT pivot.* FROM DUAL pivot;
--This Works:
DECLARE
CURSOR c1
IS
SELECT pivot.* FROM DUAL pivot;
BEGIN
NULL;
END;
--This DOES NOT Work:
CREATE OR REPLACE PROCEDURE TEST
IS
CURSOR c1
IS
SELECT pivot.* FROM DUAL pivot;
BEGIN
NULL;
END;
WORKAROUND:
If you use quotation marks around all references of the term PIVOT or UNPIVOT it works fine.
Example:
CREATE OR REPLACE PROCEDURE TEST
IS
CURSOR c1
IS
SELECT "pivot".* FROM DUAL "pivot";
BEGIN
NULL;
END;
STATUS:
Waiting for fix in a future version of Toad for Oracle.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center