0 Replies Latest reply: Aug 28, 2011 8:36 PM by user12144220 RSS

    can't pass parameter name to package?

    user12144220
      Hello, following code snippet is working normal. But when I see result by monitor tool parameter names look like v0, v1 instead of INS_EMP_NAME, INS_EMP_AGE. It should be Begin Sample_Bulk_Insert(:INS_EMP_NAME, :INS_EMP_AGE); End;. What should I do?

      Begin Sample_Bulk_Insert(:v0, :v1); End;

      :1=['ddd']
      :2=[1]

      Elapsed time: 0.000

      CREATE OR REPLACE PROCEDURE myschema.Sample_Bulk_Insert(
      INS_EMP_NAME IN VARCHAR2,
      INS_EMP_AGE IN NUMBER )
      is
      begin
      INSERT INTO EMP(NAME,AGE)
      VALUES (INS_EMP_NAME, INS_EMP_AGE);
      COMMIT;
      end;
      /

      OracleConnection conn = new OracleConnection("Data Source=ds;User ID=user;Password=pass");
      conn.Open();
      OracleCommand objCom = new OracleCommand("Sample_Bulk_Insert", conn);
      objCom.CommandType = CommandType.StoredProcedure;
      OracleParameter param1 = objCom.Parameters.Add("INS_EMP_NAME", "ddd");
      OracleParameter param2 = objCom.Parameters.Add("INS_EMP_AG", 1);
      param1.Size = 200;
      param2.Size = 10;
      objCom.ExecuteNonQuery();

      Thank you.