Subject | Re: [IBO] What component? |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-05-18T23:49:05Z |
Hi Rafael,
Before CREATE PROCEDURE, insert this line:
set term ^;
enough, that's good news for me ;-)
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.
dataset rows, so there's nothing for the caller to fetch.
end^
After that, insert these two lines:
set term ;^
commit;
Paul Vinkenoog
> I have to execute this script thougth IBO ... but I donĀ“t know whatTIB_Script. But the procedure needs a little cleaning up too:
> component I have to use ...
Before CREATE PROCEDURE, insert this line:
set term ^;
> create procedure testejosiI think this should be DECLARE VARIABLE. But if DECLARE alone is
> as
> DECLARE varCount integer;
enough, that's good news for me ;-)
> beginYou can do this better (faster) like this:
> SELECT Count(*) FROM Conta WHERE NomeConta = 'gugu' into varcount;
> if (varCount <= 0) then
> INSERT INTO Conta (NomeConta,IsAtiva) VALUES ('gugu', 1);
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;Greetings,
> drop procedure TESTEJOSI;
Paul Vinkenoog