Subject Re: [firebird-support] temporal table for stored procedure
Author Helen Borrie
At 12:02 AM 7/04/2007, you wrote:
>Hi! Is it possible in IB 7.5 to work in a stored procedure with a
>temporal table created using a SELECT? I need something like this:
>SELECT Col1, Col2, Col3 FROM TABLE1 Where Contition1 AND Condtion2
>AND ConditionN
>ORDER BY Col1, Col3
>In the procedure I need the table to be in that order and I can't
>work with the original table TABLE1 because I need to preprocess it.

In relational databases you work with sets, not tables. In
procedural language modules (stored procedures and triggers) you
define your set in a cursor and loop through that. There are two
ways to do it in InterBase: using a FOR SELECT .... INTO <set of
variables> DO or (not documented by Borland) in a named cursor (which
is faster, if you are updating the underlying table).

If you want your "temporal table" to be returned to the client
application as a dataset, you can do that too. So be clearer about
what you want to do with this so-called "temporal table". If that is
what you want, look up the IB documentation index for "selectable
stored procedures".