Oracle and Ref Cursor
Hi All,
I am trying to get a cursor back form an Oracle 8.1.6 database using
ADOExpress and the Oracle OLEDB provider (not the MS provider for Oracle). I
have tried converting the VB sample that comes with the Oracle OLEDB
provider and it seems to work, but returns a empty dataset.
This is the code that I have.
procedure TForm1.Button2Click(Sender: TObject);
var
Param1,
Param2 : TParameter;
sEmpNoValue : string;
RS : _Recordset;
begin
ADOConnection1.ConnectionString :=
'Provider=OraOLEDB.Oracle.1;Password=tiger;'
+ 'Persist Security Info=True;User ID=scott;Data
Source=DEV;PLSQLRSet=1;';
ADOConnection1.Open;
sEmpNoValue := '10';
InputQuery('Choose DEpartment', 'Enter a department number (10, 23, or
30)', sEmpNoValue);
ADOCommand1.Connection := ADOConnection1;
Param1 := ADOCommand1.Parameters.CreateParameter( 'param1', ftSmallint,
pdInput, 4, EmptyParam);
Param1.Value := StrToInt(sEmpNoValue);
Param2 := ADOCommand1.Parameters.CreateParameter( 'param2', ftSmallint,
pdOutput, EmptyParam, EmptyParam);
ADOCommand1.CommandText := '{CALL
Employees.GetEmpRecords(:param1,:param2)}';
RS := ADOCommand1.Execute;
ADODataSet1.Recordset := RS;
ADODataSet1.Open;
end;
The VB example works fine against the database and returns a record set.
I am using Win2K sp2, MDAC 2.6, ADOExpress with the unofficial MDAC 2.6
update and Oracle 8.1.6.1.
Thanks for any help
Dion