QueryRecCount and Oracle Stored Procedure bug

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
paulkdavies
Posts: 2
Joined: Thu 16 Feb 2012 11:30

QueryRecCount and Oracle Stored Procedure bug

Post by paulkdavies » Thu 16 Feb 2012 12:26

If I use the QueryRecCount option on a TUniStoredProc component which returns a ref cursor from a Stored Procedure in an Oracle database, I get the following error when calling the Open method.

ORA00907: missing right parenthesis

If QueryRecCount is set to false, the dataset is returned correctly.

Details: Delphi 2009, UniDAC 4.1.4 (problem also existed in 4.1.3), Oracle 11g Database

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 16 Feb 2012 15:44

hello,

When setting the QueryRecCount to True, the text in SQL Text turns into a query.

Code: Select all

SELECT COUNT(*) FROM (SQL.Text )
And as it is necessary to call the stored procedures in the anonymous block, when using them,

Code: Select all

BEGIN
// calling a stored procedure
END;
the error occurs when turning such code into

Code: Select all

SELCT COUNT(*) FROM (BEGIN ...  END;)
To retrieve the number of records that are returned in the cursor, you should retrieve this number directly in your procedure at a server, and return it in the OUT parameter of the procedure.

paulkdavies
Posts: 2
Joined: Thu 16 Feb 2012 11:30

Post by paulkdavies » Thu 16 Feb 2012 16:56

Ok, thanks Alex.

Post Reply