ciphersol
asked on
ORA-01036 error because of comment and text contained within comment.
I am using the "Oracle.DataAccess" class library with VB.NET. The code executes SQL statements that apply updates to a database. I have found an unusual issue where I receive the error "ORA-01036: illegal variable name/number" when executing the following statement:
CREATE OR REPLACE PROCEDURE TEST_PROC IS
BEGIN
NULL;
/** COMMENT: */
END TEST_PROC;
The error can be eliminated by modifying the comment from "/**" to "/*" so that the statement looks like the following:
CREATE OR REPLACE PROCEDURE TEST_PROC IS
BEGIN
NULL;
/* COMMENT: */
END TEST_PROC;
The command runs perfectly fine in SQL*Plus but not using the "Oracle.DataAccess" class (ExecuteNonQuery command). Modifying the statement is not an option.
Any ideas on how to correct this problem?
Oracle Database Version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
Oracle.DataAccess Version: 9.2.0.700 and 10.2.0.100
CREATE OR REPLACE PROCEDURE TEST_PROC IS
BEGIN
NULL;
/** COMMENT: */
END TEST_PROC;
The error can be eliminated by modifying the comment from "/**" to "/*" so that the statement looks like the following:
CREATE OR REPLACE PROCEDURE TEST_PROC IS
BEGIN
NULL;
/* COMMENT: */
END TEST_PROC;
The command runs perfectly fine in SQL*Plus but not using the "Oracle.DataAccess" class (ExecuteNonQuery command). Modifying the statement is not an option.
Any ideas on how to correct this problem?
Oracle Database Version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
Oracle.DataAccess Version: 9.2.0.700 and 10.2.0.100
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I am not sure about what i am going to write, but this comment resembles more like hint /** COMMENT: */ rather than comment, may be that the reason. so you can try '--' or '/* */' comments
ASKER
virdi ds,
It turns out this error occurred because I added an output parameter just prior to running the "ExecuteNonQuery" command. There is no output parameter in this case so it was unnecessary.
I wouldn't have discovered this if it was for initial request to paste the complete code. I discovered this was the issue when I was preparing the sample code snippet for you, therefore I'll give you partial credit. :)
It turns out this error occurred because I added an output parameter just prior to running the "ExecuteNonQuery" command. There is no output parameter in this case so it was unnecessary.
I wouldn't have discovered this if it was for initial request to paste the complete code. I discovered this was the issue when I was preparing the sample code snippet for you, therefore I'll give you partial credit. :)
is another way to comment lines.
I mean two minuses (--)