What are the limitations of the OracleConnectionStringBuilder.RunOnceCommand?

What are the limitations of the OracleConnectionStringBuilder.RunOnceCommand?

Postby Nonsequiturish » Mon 10 Oct 2016 21:01

I created the code shown below. There are two RunOnceCommand statements, one that works, and one that returns an Invalid SQL error at Open(). What are the valid SQL statements that can be used in the RunOnceCommand?

Code: Select all
            OracleConnectionStringBuilder myCSB = new OracleConnectionStringBuilder();
            myCSB.Direct = true;
            myCSB.Server = "myServer.myDomain.com";
            myCSB.UserId = "myUserid";
            myCSB.Password = "myPassword";
            myCSB.Sid = "mySid";
            myCSB.Home = "myOracleHome";
            myCSB.Port = 9999;
            myCSB.PersistSecurityInfo = true;

            // This one works
            // myCSB.RunOnceCommand = "INSERT INTO MY_TABLE (COLUMN1, COLUMN2) Values ('First', 'Second')";

            // This one returns an "ORA-00900: invalid SQL statement" message
            // myCSB.RunOnceCommand = "EXECUTE MY_PACKAGE.ADD('First', 'Second')";

            OracleConnection myConnection = new OracleConnection(myCSB.ConnectionString);

            myConnection.Open();
Nonsequiturish
 
Posts: 1
Joined: Mon 10 Oct 2016 20:04

Re: What are the limitations of the OracleConnectionStringBuilder.RunOnceCommand?

Postby Pinturiccio » Thu 13 Oct 2016 15:46

Code: Select all
EXECUTE PACKAGE_NAME.PROCEDURE_NAME

This is an SQL*Plus statement. dotConnect for Oracle does not support SQL*Plus commands. Try using the following one instead:
Code: Select all
BEGIN MY_PACKAGE.ADD('First', 'Second'); END;
Pinturiccio
Devart Team
 
Posts: 1978
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle