Hi Experts.
Such an error (ORA-01741 illegal zero-length identifier) is raised when I execute a dynamic statement with EXECUTE IMMEDIATE. The statement is:
INSERT INTO "T_CRES" ("ID", "VERSION#")
SELECT "ID", "VERSION"
FROM "T_CDET"
MINUS
SELECT "ID", "VERSION"
FROM "T_CDET"
INNER JOIN "T_CRES"
USING("ID")
WHERE "T_CDET"."VERSION" = "T_CRES"."VERSION#"
This SQL statement is collected from many substrings with concatenation operator ||.
When I explore the final_string, which is to be EXECUTEd IMMEDIATE next step, with raise_application_error(-2
0101, final_string), quite functional SQL statement is returned in error message. Moreover, I can copy and paste it into TOAD and execute well! But for EXECUTE IMMEDIATE it's not good.
By the way, when I try to remove quotes from "T_CRES" in INSERT INTO "T_CRES", I get another strange error "ORA-00928: missing SELECT keyword". Worth no mentioning, in TOAD it executes just fine either...
Thank you for your ideas. With best regards - Koala
immediate was called?
ASKER
ASKER
I found the problem, it was related to application logic outside the PL/SQL routine. There I fell into loop, and first pass brought correct substrings (that's why raise_application_error(..
Thank you for thinking about. Now please stop, as long as I found the problem myself, so the points will not assigned.
ASKER
Please do not assign points for this question, as long as noone made even a guess before I found problem myself.
Thanks
ASKER
Please do not assign points for this question, as long as noone made even a guess before I found problem myself.
Thanks
I will leave the following recommendation for this question in the Cleanup topic area:
PAQ/Refund - The author has found and pasted the solution
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!