Re: Urgent !! Need Help!!!

From: Safeer <safeer_at_nettaxi.com>
Date: Fri, 27 Jul 2001 11:11:37 -0400
Message-ID: <9js0bb$1epqv$1_at_ID-100405.news.dfncis.de>


create procedure addMachine ( smachinename in varchar) is
v_machineuid number;
begin
  select max(machineId) into v_machineid   from tblmacine
  where name = sMachineName;
  if v_machineid is null then

     insert into tblMachine(name) valuessMachineName);
     select Max(machineID) into iMachineID from tblMachine;
 end if;
exception when no_data_found then -- Only when first select will not find any row in that table. if u don't need remove this line

   insert into tblMachine(name) valuessMachineName);  end if;
end;

Hope this will work for you.

Regards,

Muhammad Safeer.

"CME" <support_at_cmesys.demon.co.uk> wrote in message news:996162765.1728.0.nnrp-12.c2de4217_at_news.demon.co.uk...
> Hi:
>
> Would you like to tell me how I can convert it from Sybase to Oracle?
>
> Thanks anyway!!!
> ----------------------------------------------------------
>
> alter procedure
> dba.AddMachine(in sMachineName varchar(56))
> result(MACHINEID integer) begin
> declare iMachineID integer;
> select max(MachineID) into iMachineID from tblMachine where Name =
> sMachineName;
> if iMachineID is null then
> insert into tblMachine(Name) values(sMachineName);
> select Max(machineID) into iMachineID from tblMachine
> end if
> end
>
>
Received on Fri Jul 27 2001 - 17:11:37 CEST

Original text of this message