Subject RE: [IBO] Error with stored procedure on TIBOQUERY "Can not SELECT RDB$DB_KEY"
Author Svein Erling Tysvær
I don't know what is wrong, but I react to using LIST as the name of the alias (it is an aggregate function in Firebird 2.1). If changing from List to MyList doesn't help: I think IBO adds RDB$DB_KEY to queries where there is no defined key. Maybe it can be avoided by explicitly setting your TIBOQuery to ReadOnly? Or set EditSQL, InsertSQL explicitly (don't know whether they exist in TIBOQuery, I mostly use TIB_Cursor myself and occasionally TIB_Query).

HTH,
Set

Davissammybr wrote:

I have a stored procedure that when performed on IBExpert no error.
But when I run it on the component TIBOQuery get the following message:

Can not SELECT RDB$DB_KEY from a stored procedure.

The stored procedure returns a field called IP.
When I run it generates error as below:

select
list.ip
from
My_StoredProcedure list

If you run this way the error does not happen;

select
ip
from
My_StoredProcedure

What is wrong?
Thank you.