Need no data found exception in db2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rdeshpande
    New Member
    • Jul 2013
    • 1

    Need no data found exception in db2

    Hi,
    Here is my procedure:
    Code:

    Code:
    create or replace procedure test
    (
    IN javaLocale varchar(1020)
    )
    LANGUAGE SQL
    BEGIN
    DECLARE xxlocaleid char (20);
    
    select id into xxlocaleid
    from tp2.tpv_pub_locale locale
    where locale.java_locale = substr(javalocale,1,5);
    
    begin
    declare test cursor with return for
    select xxlocaleid from SYSIBM.SYSDUMMY1;
    open test;
    end;
    
    end
    What I want to do is when there is no data found, I want this procedure to return:
    Code:

    Code:
    select 'Null', 'Null', 'inactive_rvw_cycle' rvw_cycle_name from SYSIBM.SYSDUMMY1
    How to do this in DB2.


    Thanks,
    Raghvendra Deshpande
    Last edited by Rabbit; Jul 12 '13, 03:20 PM. Reason: Please use code tags when posting code.
Working...