Page 1 of 1

Stored procedure in TSmartQuery

Posted: Mon 14 Jan 2008 10:59
by ralf
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

Posted: Tue 15 Jan 2008 10:05
by Plash
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.

Posted: Thu 24 Jan 2008 14:04
by ralf
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

Posted: Fri 25 Jan 2008 12:28
by Plash
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.