Page 1 of 1

Oracle Script Bug?

Posted: Wed 24 Jun 2009 20:58
by degas
I am using the OracleScript component and trying to run the following sql:
"set role all"
But this does not work and does not appear in the OracleMonitor (it does not even fires an exception or an error). I have managed to make it work by setting the sql to:
"begin
set role all;
end;"

I think this is not ok, because from sqlplus (also TOAD), the fisrt script runs smoothly.

Posted: Thu 25 Jun 2009 12:24
by Shalex
We will investigate the problem and notify you about the results as soon as possible.

Posted: Wed 01 Jul 2009 09:28
by Shalex
The problem is fixed. Look forward to the next build of dotConnect for Oracle.

Re: Oracle Script Bug?

Posted: Mon 29 Apr 2013 17:29
by lewis
Hi, a im trying to execute the following SQL command by setting the ScriptText property in my OracleScript, I know my SQL command is wrong, but when i execute the script nothing happens, it seems like everything was fine, however the real error is "Error: PLS-00103: Encountered the symbol "6550" when i use other IDE, also the
oraclescript does not even fires an exception or oracleScript1_Error(object sender, CoreLab.Common.ScriptErrorEventArgs e)

the following is the code :


try
{
this.oracleScript1.ScriptText = "CREATE OR REPLACE PROCEDURE Dept_Insert (\n" +
"PDeptNo NUMBER,\n" +
"PDName VARCHAR, \n" +
"PLoc VARCHAR )\n" +
"IS \n" +
"BEGIN\n" +
"\n" +
" INSERT INTO Dept(DeptNo, DName, Loc) VALUES (PDeptNo, PDName, PLoc);\n" +
"END;\n" +
" \n" +
"\n" +
"6550\n" +
" \n" +
" \n" +
"CREATE TABLE DEPT (\n" +
" DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,\n" +
" DNAME VARCHAR2(14) ,\n" +
" LOC VARCHAR2(13)\n" +
");\n" +
" \n" +
"INSERT INTO EMP VALUES\n" +
"(7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);\n";
this.oracleScript1.Execute();

}
catch (Exception ex)
{

MessageBox.Show(ex.Message);
}

Re: Oracle Script Bug?

Posted: Tue 07 May 2013 14:58
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

As a temporary workaround, try using the InfoMessage event of the OracleConnection object. For this, you should change your code as follows:

Code: Select all

try
{
this.oracleScript1.Connection.InfoMessage +=new OracleInfoMessageEventHandler(conn_InfoMessage);
this.oracleScript1.ScriptText = "CREATE OR REPLACE PROCEDURE Dept_Insert (\n" +
"PDeptNo NUMBER,\n" +
"PDName VARCHAR, \n" +
"PLoc VARCHAR )\n" +
"IS \n" +
"BEGIN\n" +
"\n" +
" INSERT INTO Dept(DeptNo, DName, Loc) VALUES (PDeptNo, PDName, PLoc);\n" +
"END;\n" +
" \n" +
"\n" +
"6550\n" +
" \n" +
" \n" +
"CREATE TABLE DEPT (\n" +
" DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,\n" +
" DNAME VARCHAR2(14) ,\n" +
" LOC VARCHAR2(13)\n" +
");\n" +
" \n" +
"INSERT INTO EMP VALUES\n" +
"(7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);\n";
this.oracleScript1.Execute();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
...

static void conn_InfoMessage(object sender, OracleInfoMessageEventArgs e)
{
    foreach (OracleError error in e.Errors)
        MessageBox.Show(error.Message);
}

Re: Oracle Script Bug?

Posted: Wed 15 May 2013 14:48
by Pinturiccio
We think that this is a designed behavior. To get an error message inside the script text, use the InfoMessage event of the OracleConnection object.