Subject Re: [IBO] What component?
Author Rafael Colucci
Thank you very much ...
Now it works better ...

Rafael Colucci



> Hi Rafael,
>
> > I have to execute this script thougth IBO ... but I donĀ“t know what
> > component I have to use ...
>
> TIB_Script. But the procedure needs a little cleaning up too:
>
> Before CREATE PROCEDURE, insert this line:
>
> set term ^;
>
> > create procedure testejosi
> > as
> > DECLARE varCount integer;
>
> I think this should be DECLARE VARIABLE. But if DECLARE alone is
> enough, that's good news for me ;-)
>
> > begin
> > SELECT Count(*) FROM Conta WHERE NomeConta = 'gugu' into varcount;
> > if (varCount <= 0) then
> > INSERT INTO Conta (NomeConta,IsAtiva) VALUES ('gugu', 1);
>
> You can do this better (faster) like this:
>
> if ( not exists ( select * from Conta where NomeConta = 'gugu' ) )
> then insert into Conta( NomeConta, IsAtiva ) values ( 'gugu', 1 );
>
> This also means that you can drop the varCount variable.
>
> > suspend;
>
> The SUSPEND should be removed: this procedure doesn't return any
> dataset rows, so there's nothing for the caller to fetch.
>
> > end;
>
> Change this to:
>
> end^
>
> After that, insert these two lines:
>
> set term ;^
> commit;
>
> > execute procedure TESTEJOSI;
> > drop procedure TESTEJOSI;
>
>
> Greetings,
> Paul Vinkenoog
>
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>