OracleScript Bind Values

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

OracleScript Bind Values

Post by benbahrenburg » Mon 02 Oct 2006 19:19

Hi,

Is there a way to bind all values in the SQL string used by the OracleScript object?

For example

Insert into ( ) values (:pA, :pB);
Insert into ( ) values (:pA, :pB);
Insert into ( ) values (:pA, :pB);
Insert into ( ) values (:pA, :pB);
Insert into ( ) values (:pA, :pB);

Can I bing all of the values at once, or do I need to create a PL/SQL block for each one?

Best Regards

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 03 Oct 2006 08:08

If i got you right, you want something like this:

Code: Select all

cmd.Parameters["pA"].Value = new int[] { 1, 2, 3, 4, 5 };
cmd.Parameters["pB"].Value = new int[] { 11, 12, 13, 14, 15 };
For more information please read "Working with Array Binding" article of OraDirect .NET help documentation.

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

OracleScript Bind Values

Post by benbahrenburg » Tue 03 Oct 2006 18:25

Hi Alexey,

Does the OracelScript object use the command object?

I'm using the below syntax. Could you give me the syntax to use the command object witin the OracleScript object?

Below is the syntax I'm using

objScript = new OracleScript(SQLString, DataBaseConnection);
objScript.Execute();

Thanks in advance

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 04 Oct 2006 06:40

With only one OracleScript component you can execute several SQL statements as one. This sequence of statements is named script. To separate single statements use semicolon (; ) or slash (/) symbols and for PL/SQL only slash. Note: Slash must be the first character in the line.
Script looks like the one which is passed to SQL Plus, but without specific SQL Plus command.
For more information please read OraDirect .NET help documentation.

Post Reply