Stored procedure in TSmartQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ralf
Posts: 5
Joined: Mon 14 Jan 2008 10:35

Stored procedure in TSmartQuery

Post by ralf » Mon 14 Jan 2008 10:59

Can I run a stored procedure with return parameter (cursor) in a TSmartQuery? I fill it with following SQL:

begin
cs_dbtag_mgmt.GetTags( PVRESULT => :PVRESULT );
end;

where result is a cursor. When I open the dataset I get the error:

SQL statement doesn't return rows.

I don't want to use a stored-procedure component. Is this possible?

Thanks in advance

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 15 Jan 2008 10:05

A stored procedure with cursor parameter can be opened using TSmartQuery. You should set DataType of parameter to ftCursor.

The error that you have received occurs when you try to open a statement that does not return cursor. This error should not occur if a stored procedure returns cursor. Please provide the full source code that causes the error.

ralf
Posts: 5
Joined: Mon 14 Jan 2008 10:35

Post by ralf » Thu 24 Jan 2008 14:04

Okay, I think the problem was with RemObjects that isn't able to pass cursor-type for parameters (strange but true).
When I fixed this other queries seem to fail.
For example a stored procedure that has no cursor parameters but only output parameters of other types.
Can I open such a dataset with Open; of should I use Execute();?
Can such a component detect this automatically? Is there a property for this?

Thanks in advance

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 25 Jan 2008 12:28

You can call Open method only for stored procedures that return a cursor.

Execute method can be called for any stored procedure. In this case ODAC detects automatically, if a cursor should be opened.

Post Reply