Gazi Erdogan

"A goal without a plan just a wish"

Örnek Fonksiyon

CREATE OR REPLACE FUNCTION gazi_event_stok01 (

   old_assigned in number, new_assigned in number)

RETURN varchar2

IS

sonuc_  varchar2(5);

BEGIN

  if old_assigned < new_assigned then

    sonuc_ := 'GIRIS';

    else

      sonuc_ := 'CIKIS';

      end if;

   RETURN sonuc_;

end;

 

 

--------

 

CREATE OR REPLACE FUNCTION gazi_event_mail01

       (mail_comp_    in varchar2, mail_site_    in varchar2,

               mail_eventid_  in varchar2,mail_anahtar_ in varchar2)

  RETURN varchar2

  IS

  sonuc_ varchar2(2000);

  cursor c1 is

   SELECT mail_mails

     FROM gazi_event_mails

     where mail_company = mail_comp_

     and mail_site = mail_site_

     and mail_eventid = mail_eventid_

     and mail_anahtar = mail_anahtar_;

       

BEGIN  

     open c1;

     fetch c1 into sonuc_;

     

      if c1%notfound then

      sonuc_ := 'gazie@diaholding.com';

      end if;

   

     close c1;

     

  RETURN sonuc_;

end;

Comments are closed