Page 1 of 1

OracleScript Bind Values

Posted: Mon 02 Oct 2006 19:19
by benbahrenburg
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

Posted: Tue 03 Oct 2006 08:08
by Alexey
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.

OracleScript Bind Values

Posted: Tue 03 Oct 2006 18:25
by benbahrenburg
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

Posted: Wed 04 Oct 2006 06:40
by Alexey
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.