What's the best way to separate SQL claims to transmit for an Oracle ADO.Internet client? For example, allows if you have the next code inside a text file and wish to execute these claims:

CREATE TABLE foo (bar VARCHAR2(100));
INSERT INTO foo (bar) VALUES('one');
INSERT INTO foo (bar) VALUES('two');

In my opinion attempting to send all individuals in a single Command may cause Oracle to complain concerning the "". My first thought is always to split on "" character, and send them individually.

But, Saved methods can contain semi-colons too, just how would I allow it to be therefore the split routine would keep your whole saved proc together? Must it search for begin/finish claims too, or "/"?

Can there be any difference during these respects between ODP.Internet and also the Micrsoft Oracle Provider?

With no DDL, you can create an anonymous PL/SQL block by all around the claims with BEGIN and Finish:

BEGIN
  INSERT INTO foo (bar) VALUES('one');
  INSERT INTO foo (bar) VALUES('two');
END;

To do DDL (like CREATE TABLE) you should use dynamic PL/SQL:

BEGIN
  EXECUTE IMMEDIATE 'CREATE TABLE foo (bar VARCHAR2(100))';
  EXECUTE IMMEDIATE 'INSERT INTO foo (bar) VALUES(:v)' USING 'one';
  EXECUTE IMMEDIATE 'INSERT INTO foo (bar) VALUES(:v)' USING 'two';
END;

The Card inserts will also be dynamic, because the table doesn't exist just before running the block so it would neglect to compile.

NOTE: This is a unique requirement: programs shouldn't normally be creating tables!

A business known as devart (www.devart.com) create a library known as dotConnect for Oracle.

This library consists of a category known as OracleScript which is able to separate a SQL script that contains multiple claims.

To grow on Tony's answer, you should use an Anonymous block to get this done, you'll have to make certain the string is being employed as you anticipate. This can be a Lower AND DIRTY example, virtually splitting around the and creating the block.

using System;
using System.Data;
using System.Text;
using System.Reflection;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

namespace ODPSample
{
    class Class1
    {

        private static string formatAnonBlock(string userData)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("Begin ");
            string[] statements = userData.Split(';');
            foreach (string s in statements)
            {
                if (s.Length > 0)
                {
                    sb.AppendFormat(" EXECUTE IMMEDIATE '{0}';", s.Replace("'", "''"));
                }
            }
            sb.Append(" END ; ");
            return sb.ToString();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Demo: Anon Block");

            // Connect
            string connectStr = "User Id=scott;Password=tiger;Data Source=database";

            string userInputtedSQL;
            userInputtedSQL = "Create table ABC(val varchar2(50)); insert into ABC values('123');insert into ABC values('567');";

            string anonBlock;
            anonBlock = formatAnonBlock(userInputtedSQL);
            Console.WriteLine(anonBlock);

            OracleConnection connection = new OracleConnection(connectStr);
            OracleCommand cmd = new OracleCommand(anonBlock, connection);


            try
            {
                connection.Open();
                cmd.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.WriteLine("Done");
        }
    }
}