Page 1 of 1

Cursors again

Posted: Thu 22 Jun 2006 10:09
by Matteo
Why executing a stored and fetching data to a dataset (Brani) with the following code

Code: Select all

OraSQL.ParamByName('p_id_bersaglio').AsInteger := IdTarget;
OraSQL.ParamByName('p_modalita').AsString     := Modalita;
OraSQL.ParamByName('p_data').DataType := ftCursor;
OraSQL.Execute;
Brani.Cursor := OraSQL.ParamByName('p_data').AsCursor;
works fine, instead using

Code: Select all

OraSQL.Params.CreateParam(ftInteger, 'p_id_bersaglio', ptInput).AsInteger := IdTarget;
OraSQL.Params.CreateParam(ftString, 'p_modalita', ptInput).AsString := Modalita;
OraSQL.Params.CreateParam(ftCursor, 'p_data', ptOutput);
OraSQL.Execute;
Brani.Cursor := OraSQL.ParamByName('p_data').AsCursor;
it gives me "Cursor must be opened" exception??

Thanks in advance,

Posted: Thu 22 Jun 2006 12:17
by Challenger
Did you call Brani.Open method?

Posted: Thu 22 Jun 2006 13:29
by Matteo
the row

Brani.Cursor := OraSQL.ParamByName('p_data').AsCursor;

raised the exception.

Posted: Fri 23 Jun 2006 12:29
by Challenger
We couldn't reproduce this error. Please send to ODAC support address complete sample that demonstrates this problem and include script to create server objects.