一般对于数据库操作的sql语句,vb中都可以运行。但是有一些只能用PL/SQL对数据库进行操作的语句,能否用vb进行运行呢?否则就只能单独在oracle中进行运行,不能编译出来成应用不太方便。如果有可否有实例代码参考?多谢!

解决方案 »

  1.   

    可以的,将整个 plsql 块的提交给 oracle 就可以执行。 \我也不大懂vb ,你可以到 VB 版块问问,或者找找版主给你移动到 VB 版块。
      

  2.   


    就是比如有一段PL/SQL代码,以下作为例子,需要用vb来编译成exe文件,只要运行这个exe文件就会在oracle数据库里面运行这段代码。 因为之前做法都是把这个代码拷贝到pl/sql developer界面中去手动运行,不能够实现自动化功能。现在想要用vb来实现自动运行的功能。declare
    cursor c_esl is
    select loop_name,loop_set_name from aaa_loop_esl;
    begin
    for v_esl in c_esl loop
    update esl_setting_data set loop_set_id = (select loop_set_id from esl_setting where loop_set_name = 
    v_esl.loop_set_name) where id_1 in (select loop_id from loop where loop_name = v_esl.loop_name);
    end loop;
    commit;
    end;
    /