Page 1 of 1

Cursor, Smart Query, DBGrid and incorrect data

Posted: Thu 01 Dec 2005 09:16
by Eugenie
Hi!

My stored procedure returns cursor. I'd like to view data from this cursor in DBGrid. Sometimes all is OK, sometimes I don't get any data in DBGrid even my cursor is very simple, just like select * from company, without any input parameters.

I use CBuilder 5, ODAC 5.00 and this is my technology.

I have SmartQuerySelectData, SmartQueryToDBGrid, DataSourceCursor and DBGridCursor.

DataSourceCursore->DataSet=SmartQueryToDBGrid ;

DBGridCursor->DataSource=DataSourceCursor;

I select data
SmartQuerySelectDate->SQL->Add("BEGIN my.pack.my_proc( OutCursor OUT REFCURSORType); END;")
SmartQuerySelectDate->Execute();

then I link SmartQuerySelectDate and SmartQueryToDBGrid:
SmartQueryToDBGrid->Cursor=SmartQuerySelectDate ->ParamByName("OutCursor")->AsCursor;

then I open my cursor

SmartQueryToDBGrid->Open();

Probably some mistakes can appear in this code - this is not working code, but example only.
Once again, sometimes I get correct data, with many input parameters and complex query in my proc. Sometimes I don't get data.
What's wrong in my code? May be some SmartQuery properties must by set ?

Thank you very much for your help.

Posted: Tue 06 Dec 2005 07:52
by Alex
Sorry, we cannot reproduce your problem. We need more detailed description i.e. your full Oracle client/server versions, ODAC version, complete sample to demonstrate your problem and script to create server objects.
Please, send a message to our ODAC support e-mail address.

Posted: Thu 08 Dec 2005 06:17
by Guest
Alex, thank you for reply, but I have resolved my problem by using other types of components. I use OraSQL instead of SmartQuerySelectDate and OraQuery instead of SmartQueryTODBGrid - and all is OK with my queries.