sql – how to call a function in plsql function

sql – how to call a function in plsql function

Here is an example how to run function. There are two ways to do that.

  1. Try to add result value:

    result := askidan_indir(prm_dosya_id,
               prm_aciklama,
               prm_kullanici_id,
               prm_ask_ind_kayit_sayisi,
               prm_hata_metni,
               prm_hata_kodu )
    
  2. You can also use your function in select statement:

    select askidan_indir(prm_dosya_id,
                     prm_aciklama,
                     prm_kullanici_id,
                     prm_ask_ind_kayit_sayisi,
                     prm_hata_metni,
                     prm_hata_kodu) 
    into result  
    from dual;
    

Functions must return a value, else you should have an assignment target to the function.

FUNCTION ortak_icra_job(prm_dosya_id             dosya.id%TYPE,
                     prm_aciklama             icra_hareket.aciklama%TYPE,
                     prm_kullanici_id         kullanici.id%TYPE,
                     prm_ask_ind_kayit_sayisi OUT NUMBER,
                     prm_hata_metni           OUT VARCHAR2,
                     prm_hata_kodu            OUT hata_mesaji.id%TYPE) 
  RETURNS VARCHAR2 IS
v_result varchar2(200);
BEGIN

v_result := askidan_indir(prm_dosya_id ,
               prm_aciklama ,
               prm_kullanici_id ,
               prm_ask_ind_kayit_sayisi ,
               prm_hata_metni ,
               prm_hata_kodu );
RETURN v_result;
END;

sql – how to call a function in plsql function

Leave a Reply

Your email address will not be published.