About TOraQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
id_odac
Posts: 7
Joined: Thu 22 Dec 2005 02:59

About TOraQuery

Post by id_odac » Thu 22 Dec 2005 03:06

1. Difference between 'next' and 'findnext' ???
2. 'query.options.queryreccount = true ' cause errors sometimes./ y?

-------
Thank u.

id_odac
Posts: 7
Joined: Thu 22 Dec 2005 02:59

Re: About TOraQuery

Post by id_odac » Thu 22 Dec 2005 09:02

up for myself.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 22 Dec 2005 10:31

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.

id_odac
Posts: 7
Joined: Thu 22 Dec 2005 02:59

Post by id_odac » Fri 23 Dec 2005 04:01

: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 ??

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 23 Dec 2005 09:57

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.

id_odac
Posts: 7
Joined: Thu 22 Dec 2005 02:59

Post by id_odac » Sat 24 Dec 2005 11:34

ok. thank u for your patience!

Merry Xmas!!.

Post Reply