Array Binding

xiaoxiao2021-03-06  50

... // Create An Array Of Values ​​That Need To Be Insertedint [] MyArrayDeptno = New Int Int Int Int Int Int Int Int IntinT [] {10, 20, 30};

// set the command text on an oracleCommand Objectcmd.commandtext = "INSERT INTO DEPT (DEPTNO) VALUES (: Deptno)";

// set the arraybindcount to indeicate the number of valueScmd.ArraybindCount = 3;

// Create a parameter for the array OperationsoracleParameter prm = new OracleParameter ("deptno", oracledbtype.int32); prm.direction = parameterdirection.input; prm.value = myarraydeptno;

// Add the parameter to the parameter collectioncmd.parameters.add (prm);

// Execute the commandcmd.executenonquery ();

转载请注明原文地址:https://www.9cbs.com/read-91159.html

New Post(0)