我们现在使用的是mysql数据库和ibatis一起使用,很多存储过程都是直接返回bean的集合加out参数
现在要更换oracle数据库了,不知道有没有否能同时返回集合和OUT参数的存储过程,或者有其他方法?请教各位大哥

解决方案 »

  1.   

    CREATE DEFINER=`gehouse`@`%` PROCEDURE getAccountDetialByLoginnameAndPassword`(IN _login VARCHAR(32), IN _psw VARCHAR(32), OUT _ret INTEGER(10), OUT _id INTEGER(10), OUT _name VARCHAR(32), OUT _email VARCHAR(32), OUT _phone VARCHAR(20), OUT _active INTEGER(11))
        SQL SECURITY INVOKER
    BEGIN
        DECLARE CONTINUE HANDLER FOR NOT FOUND set _ret =-1;    set _ret = 0 ;    -- get base account information
        select id,name,email,phone,active
        into _id,_name,_email,_phone,_active
        from tx_account
        where tx_account.`loginname`=_login and tx_account.`password`=MD5(_psw) and active=1;    if _ret = 0 then
           -- get role list of account
           select a.id as id ,a.name as name,a.priority as priority
           from tx_account_role b left join tx_role a on b.role=a.id
           where b.account=_id;
        end if;
    END;
    就比如这个存储过程,怎么翻译成oracle的呢,或者是postgresql的也可以
    在线等~!