Page 1 of 1

About TOraQuery

Posted: Thu 22 Dec 2005 03:06
by id_odac
1. Difference between 'next' and 'findnext' ???
2. 'query.options.queryreccount = true ' cause errors sometimes./ y?

-------
Thank u.

Re: About TOraQuery

Posted: Thu 22 Dec 2005 09:02
by id_odac
up for myself.

Posted: Thu 22 Dec 2005 10:31
by Challenger
The difference between Next and FindNext methods you can see if you set Filter property and
don't set Filtered property to True. In this case FindNext method will navigate to
next matched record. We couldn't reproduce your problem with OueryRecCount option. Please
specify your ODAC version and SQL statement on which you get an error.

Posted: Fri 23 Dec 2005 04:01
by id_odac
:D
Thank u !~

The 2nd situation is this:

...ODAC version : 5.10.0.5
... Delphi ver: 7 or 2005

i expect to use the OraQuery to execute a procedure which returns a Cursor! and i want to know how many data rows returns first.

-- my Application source :
Query.Options.QueryRecCount := true;
Query.CreateProcCall('XXX');
Query.Open;
-- my procedure:
create or replace procedure xxx(curItem out pkgTest.curItem);
// pkgTest.curItem defined in a package.

-----This is ODAC source(i think problems here ):
this function : {function TOraDataSet.GetRecCount: longint;}
has code like this :
///////////////////////////////////////
St := FinalSQL;
St := {$IFDEF CLR}CoreLab.Odac.{$ENDIF}Ora.SetOrderBy(St, '');
St := 'SELECT Count(*) FROM (' + LineSeparator + St + ')';
/////////////////////////////////////////

while "finalSql" has been built in the function "CreateProcCall"
finalSql = " begin xxx(:curItem); end; "

the variant "ST" come to this:
" select cout(*) from (begin xxx(:curItem); end; ) ";

\===
so ,will this cause a basic SQL error ??

Posted: Fri 23 Dec 2005 09:57
by Challenger
QueryRecCount option works only for SQL SELECT statements. As for statements like yours please
use RowsProcessed property of TORAQuery with FetchAll property set to True.

Posted: Sat 24 Dec 2005 11:34
by id_odac
ok. thank u for your patience!

Merry Xmas!!.