?
Solved

stored proc in firebird

Posted on 2005-05-02
3
Medium Priority
?
474 Views
Last Modified: 2013-12-09
hello,
I want to do a stored procedure in Firebird who is return 3 output variables.
my request sql is :
select v.nom_vendeur,  v.prenom_vendeur
from vendeur v, relvendeurgare r, gare g
where v.id_vendeur = r.vendeur_idvendeur
and g.id_gare = r.gare_idgare
and g.prefixe_id =:prefixeid
and v.num_serie_carte =:numserie

prefixeid and numserie were params in entry
I want for out :
present =1 if exist a rows return by the request
nom_vendeur
prenom_vendeur

tks u for u help
0
Comment
Question by:tlpacheco
1 Comment
 
LVL 19

Accepted Solution

by:
Nick Upson earned 200 total points
ID: 13915529
CREATE PROCEDURE my_proc (prefixeid     INTEGER,
         numserie     INTEGER)
returns (present 1)
AS
begin
select count(*)
from vendeur v, relvendeurgare r, gare g
where v.id_vendeur = r.vendeur_idvendeur
and g.id_gare = r.gare_idgare
and g.prefixe_id =:prefixeid
and v.num_serie_carte =:numserie
INTO present;
if (present > 0) then
 present = 1;
end

call it as

execute procedure myproc(1, 2)

I've had to assume the parameters are integer
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question