在pl / sql中编写程序。在vb.net中调用此过程。我想用pl / sql过程的结果填充数据集。但我得到空数据集。在pl / sql中我能够在我的应用程序中看到输出oracle.dataaccess.client dll。帮我获取数据集中的结果。
using this dll
Imports Oracle.DataAccess.Client
my code
Dim orc1 As Oracle.DataAccess.Client.OracleConnection
orc1 = New OracleConnection("Data Source=xxx;User Id=qqq;Password=123;")
orc1.open()
Dim objcommand3 As New Oracle.DataAccess.Client.OracleCommand
objcommand3.Connection = orc1
objcommand3.CommandText = "SMSDND.pro_mod934"
objcommand3.CommandType = CommandType.StoredProcedure
Dim oraada As New OracleDataAdapter(objcommand3)
'oraada .SelectCommand =objcommand3
Dim ods As New DataSet
oraada.Fill(ods)
procedure in pl/sql(using oracle toad)
CREATE procedure SMSDND.pro_mod934
as
cursor c78 is
SELECT smsdnd.phonenumbers_tbl.FLD_PHONENUMBER
FROM smsdnd.phonenumbers_tbl
WHERE not exists (select smsdnd.smsdnd_tbl.FLD_PHONENUMBERS from smsdnd.smsdnd_tbl
where smsdnd.smsdnd_tbl.FLD_PHONENUMBERS = smsdnd.phonenumbers_tbl.FLD_PHONENUMBER and smsdnd.smsdnd_tbl.FLD_OPSTYPE='A');
m smsdnd.phonenumbers_tbl.FLD_PHONENUMBER %type;
BEGIN
OPEN c78;
LOOP
FETCH c78 INTO m;
EXIT when c78%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(''|| m);
END LOOP;
CLOSE c78;
EXCEPTION WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
end;
/