oracle----globle temp table
在sybase中的存储过程可以写临时表,但是oracle不行,不能写创建语句所以。。定义全部临时表 create global temporary tablePROC_SSDAYCONFPART_TEMP(confidvarchar(20) not null,partcountinteger not null)on commit preserve rows;什么时候需要临时表?比如我们传入一个字符串,然后把这个字符串分割后需要插入n条记录,那么我们先插入到临时表,然后再一次性插入create or replace global temporary table temptable(col varchar2(2000))on commit delete rows;create or replace procedure updaterole_proc--修改角色(user_id_str varchar2, parm_user_role varchar2)asbegin get_user_id(user_id_str); update user_info set user_role=parm_user_role where user_id in (select col from temptable);--这里使用了 commit;end;/
页:
[1]