Page 1 of 1
Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 07:27
by hao2013
Hi,
I want to call a stored procedure return a cursor, but I found, I execute a stored procedure and return a Bug using OraStoredProc, in fact he executed multiple times, or two calls a stored procedure.
A deposit paid storage content
CREATE OR REPLACE PROCEDURE test
(cur out curvar)
Is
Vlsh number (8);
Begin
Select lsh_seq.nextval into vlsh from dual;
Insert into tabtest (AA) values (vlsh);
Open cur for select * from tabtest;
End;
Please help to see where is the problem?
Hao
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 08:44
by AlexP
Hello,
Please specify the exact versions of your IDE and ODAC, server and client, also the text or a screenshot of the error message. In addition, provide the script for creating the curvar type.
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 08:48
by hao2013
Delphi XE4, ODAC 9.0.1
In addition, I want to perform this step
Var
Ret:OleVariant;
Begin
OraQuery1.SQL.Text: ='begin (test: CUR); end;';
OraQuery1.ParamByName ('CUR'):.DataType = ftCursor;
OraQuery1.Open;
RET: = DataSetProvider1.Data;
A fault.
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 09:04
by hao2013
Oracle 10.2.0.1(OCI)
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
OraQuery1.SQL.Text := 'begin yp_test(:CUR); end;';
OraQuery1.ParamByName('CUR').DataType := ftCursor;
OraQuery1.Open;
ClientDataSet1.Data := DataSetProvider1.Data; //The first execute a stored procedure that returns a record;Second to execute the stored procedure returns three records
end;
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 11:27
by AlexP
Hello,
Such behaviour is due to the fact that you firstly call Open of OraQuery (a stored procedure is executed), and then recall OraQuery execution on assigning ClientDataSet1.Data := DataSetProvider1.Data;
To solve the problem, you should delete the OraQuery1.Open; line.
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 11:58
by hao2013
AlexP,Thanks.
Re: Bug in OraStoredProc?
Posted: Wed 11 Sep 2013 12:39
by AlexP
Hello,
If you have any other questions, feel free to contact us