ibcscript and create procedure

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
calou
Posts: 116
Joined: Tue 27 May 2008 12:46

ibcscript and create procedure

Post by calou » Tue 16 Feb 2010 12:43

Hello,

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 ; ^^
But it doesn't work.

What should be the correct syntax?

Thanks for help

Regards

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Tue 16 Feb 2010 13:20

I delete SET TERM and now it is ok

Now i want to do a grant on the procedure

Code: Select all

CREATE PROCEDURE P_COMPARE_TACHES
AS

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;

GRANT ALL ON P_COMPARE_TACHES TO ADMINISTRATIF
i have the error :

Dynamic SQL Error
SQL error code = -104
Token unknown - line 20, column 1
GRANT

Thanks for help

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Tue 16 Feb 2010 16:13

I solved the problem by using /

Regards

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 17 Feb 2010 08:39

It is good to see that this problem has been solved.

tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Post by tsteinmaurer » Wed 17 Feb 2010 13:56

Perhaps using SET TERM is related to the other threads posted some days ago? In InterBase/Firebird speech, SET TERM is a legal construct to redefine the terminator symbol when creating stored procedures and triggers.

The slash symbol / is a Oracle thingy though.

Thought worth mentioning, as this is the IBDAC forum for InterBase and Firebird. :D

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 24 Feb 2010 10:02

We have fixed the problem fith SET TERM. The fix will be included in the next build of IBDAC.

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Wed 24 Feb 2010 10:46

Thanks for the feedback

Regards

Post Reply