Subject Re: [firebird-support] unasigned code in stored procedures
Author Diego - DM2
It happens with more that on procedure....they all are procedures for
insert, update or delete records..... follows the code of a small one. I
call it in delphi with the SQLStoredProc component (dbexpres). But the
really WEIRD thing is that the procedure X is working fine, but all of suden
it starts to give that error....then I recreate it, it works for a few days
then the error appears again......

COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;

/* Stored procedures */

CREATE PROCEDURE "OPBANCOS"
(
"CODIGO" INTEGER,
"NOME" VARCHAR(50),
"TIPOOP" VARCHAR(3)
)
RETURNS
(
"MENSAGEM" VARCHAR(50)
)
AS
declare variable ultimocodigo integer;
begin
if (:tipoop='C') then begin
select max(codigo)+1 from bancos into :ultimocodigo;
if (:ultimocodigo is null) then begin
MENSAGEM =1;
end else
MENSAGEM = :ultimocodigo;
end
if (:tipoop='D') then begin
delete from Bancos where codigo = :codigo;
end
if(:tipoop='A') then begin
update bancos
Set nome=:nome
Where codigo=:codigo;
end
if (:tipoop='I') then begin
select max(codigo) + 1 from Bancos into :ultimocodigo ;
if (:ultimocodigo is null) then codigo=1;
insert into bancos values(:codigo, :nome);
mensagem = :ultimocodigo;
end
end
^
SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON;


Tanks,
Diego

----- Original Message -----
From: "Alan McDonald" <alan@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, December 18, 2003 10:35 AM
Subject: RE: [firebird-support] unasigned code in stored procedures


> > Hello all....
> >
> > I'm having a strange problem with Stored Procedures using FB
with
> > delphi. Sometimes when i try to execute then, I get an error: "unasiged
> > code", and the procedure does not execute....The strange thing is
> > that if I
> > drop the procedure and recreate it, it woks fine....does anybody know
why
> > this is hapening? (I'm still on firebird 1.0.3 with dbexpress)
> >
> > Thank's,
> > Diego
>
> Do you want to show us the SP code? and mabe the code for calling it?
> Alan
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>