I want to create a stored procedure with ibcscript
I enter this in the sql editor
Code: Select all
SET TERM ^^ ;
CREATE PROCEDURE P_COMPARE_TACHES
AS
/*
You can change this template in the template editor:
File | Preferences | Object Templates
Procedure:
Author : ,
Date : 16/02/2010 12:43:16
Purpose :
Version :
Modifications :
Params
------
:
*/
declare variable ident integer;
declare variable nb integer;
declare variable nom char(30);
declare variable type_tache char(30);
declare variable societe char(30);
begin
for select ID,NOM,TYPE_TACHE,SOCIETE from TACHE_CLIENT into :ident,:nom,:type_tache,:societe do
begin
select count(id) from TACHE where NOM=:nom and TYPE_TACHE=:type_tache and SOCIETE=:societe into :nb;
if (nb=0) then
delete from TACHE_CLIENT where ID=:ident;
end
end ^^
SET TERM ; ^^
What should be the correct syntax?
Thanks for help
Regards