Subject | Re: [firebird-support] stored procedures - Part 1 SELECT |
---|---|
Author | Helen Borrie |
Post date | 2003-09-22T23:47:58Z |
At 02:15 PM 22/09/2003 -0700, you wrote:
sets. But you still have to define the output in a "returns" clause.
returns (output1, output2....whole column list)
as
begin
for select col1, col2...whole column list
from Paises
into :output1, :output2......etc. DO
SUSPEND;
end
(Id INTEGER)
returns (output1, output2....whole column list)
as
begin
for select col1, col2...whole column list
from Paises
where Id = :Id
into :output1, :output2......etc. DO
SUSPEND;
end
select * from pa_Pais_Consultar
and
select * from pa_Pais_Consultar3 (constant_value)
I'm curious why you need SPs to get these sets.
There is a documentation about writing SPs. Get the IB 6 beta doc Language
Reference (langref.pdf) from the www.ibphoenix.com site, at Downloads >
InterBase.
heLen
>Ok, my SPs dont handle Tranasactions, just SELECTs, INSERTs, DELETEs,Firebird has "selectable stored procedures" for returning multiple-row
>UPDATEs.
>
>I woul like you help me with these SELECT Stored Procedures, are simple
>but I can`t retieve the results to my aplication.
>
>I wan to retrive the rows of these selects, not by return parameters, that
>are I retrieve in this moment.
sets. But you still have to define the output in a "returns" clause.
>sqlserver:CREATE PROCEDURE pa_Pais_Consultar
>
>-----------------------------------------------------------------------
>
>CREATE PROCEDURE pa_Pais_Consultar
>AS
> SELECT * FROM Paises
>
>GO
returns (output1, output2....whole column list)
as
begin
for select col1, col2...whole column list
from Paises
into :output1, :output2......etc. DO
SUSPEND;
end
>-----------------------------------------------------------------------CREATE PROCEDURE pa_Pais_Consultar3
>
>And this one (sqlserver):
>
>-----------------------------------------------------------------------
>
>CREATE PROCEDURE pa_Pais_Consultar
> @Id INTEGER
>AS
> SELECT * FROM Paises WHERE [Id] = @Id
>GO
>
>------------------------------------------------------------------------
(Id INTEGER)
returns (output1, output2....whole column list)
as
begin
for select col1, col2...whole column list
from Paises
where Id = :Id
into :output1, :output2......etc. DO
SUSPEND;
end
>I Call thes SPs in this way:Firebird calls them like this:
>
>EXEC pa_Pais_Consultar
>
>And
>
>EXEC pa_Pais_Consultar 3
select * from pa_Pais_Consultar
and
select * from pa_Pais_Consultar3 (constant_value)
I'm curious why you need SPs to get these sets.
There is a documentation about writing SPs. Get the IB 6 beta doc Language
Reference (langref.pdf) from the www.ibphoenix.com site, at Downloads >
InterBase.
heLen