简体   繁体   中英

How to call oracle Stored procedure based on the item selected from drop-down

I have stored procedure for Add, Delete and update.. I want create an drop down in visual basic with items Add,Delete and update. When I select Add, the procedure for Add should be called

This will achieved by passing one extra parameter to proc. If drop down values is equal to ADD then you can pass p_action parameter as 'ADD' in below proc so that your only add part will execute.do the same for delete and update.

create or replace procedure do_trans(p_par number,p_action varchar2(10))
begin
    if p_action='ADD' then
        --your addition code
        .
        .
    elsif p_action='DELETE' then
       --your deletionn code
        .
        . 
    elsif p_action='UPDATE' then        
       --your UPDATION code
    end if;   
exception when others 
    --your exceptionhaldling code
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM