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
QueryRecCount and Oracle Stored Procedure bug
-
paulkdavies
- Posts: 2
- Joined: Thu 16 Feb 2012 11:30
hello,
When setting the QueryRecCount to True, the text in SQL Text turns into a query.
And as it is necessary to call the stored procedures in the anonymous block, when using them,
the error occurs when turning such code into
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.
When setting the QueryRecCount to True, the text in SQL Text turns into a query.
Code: Select all
SELECT COUNT(*) FROM (SQL.Text )Code: Select all
BEGIN
// calling a stored procedure
END;Code: Select all
SELCT COUNT(*) FROM (BEGIN ... END;)