모든 행을 GAMETABLE에 표시하고 행 중 하나를 HOWTOPLAY에 표시하려고합니다. 내가 주위에 봤지만 두 개의 테이블에서 하나의 커서로 열을로드하고 그들을 표시하는 방법을 알아낼 수 없습니다.다른 테이블의 열을 커서로로드하고 표시하려면 어떻게합니까?
오라클 11g을 사용하십시오.
이 내 저장 프로 시저 코드 :
PROCEDURE GetLotteryGame (lg_id IN number, lg_ref OUT lotg_ref_cursor) IS
BEGIN
OPEN lg_ref FOR
SELECT a.GAMEDETAILSID,a.GAMENAME,a.GAMECOST,a.GAMEDESCRIPTION,a.WHERETOPLAY,b.HOWTOPLAYINFO
FROM GAMEDETAILS a
INNER JOIN HOWTOPLAY b
on b.GAMEDETAILSID = a.GAMEDETAILSID
WHERE a.GAMEDETAILSID >= lg_id;
END GetLotteryGame;
이 내 호출 프로 시저 코드 :
SET SERVEROUTPUT ON size 100000
DECLARE
v_cursor LOTTERYGAMEPKG.lotg_ref_cursor;
v_gamedetailsid GAMEDETAILS.gamedetailsID%type;
v_gamename GAMEDETAILS.gamename%type;
v_gamecost GAMEDETAILS.gamecost%type;
v_gamedescription GAMEDETAILS.gamedescription%type;
v_wheretoplay GAMEDETAILS.wheretoplay%type;
v_howtoplayinfo HOWTOPLAY.howtoplayinfo%type;
BEGIN
LOTTERYGAMEPKG.GetLotteryGame(lg_id => 1,
lg_ref => v_cursor);
LOOP
FETCH v_cursor
INTO v_gamedetailsID, v_gamename, v_gamecost, v_gamedescription, v_wheretoplay, v_howtoplayinfo;
EXIT WHEN v_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(v_gamedetailsID || ',' || v_gamename || ',' || v_gamecost || ',' || v_gamedescription || ',' || v_wheretoplay || ',' v_howtoplayinfo);
END LOOP;
CLOSE v_cursor;
END;
오류 보고서 :
Error report -
ORA-06550: line 17, column 143:
PLS-00103: Encountered the symbol "V_HOWTOPLAYINFO" when expecting one of the following:
) , * & = - + </> at in is mod remainder not rem =>
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec as between from using || member submultiset
The symbol "," was substituted for "V_HOWTOPLAYINFO" to continue.
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
어떤 오류가 발생 했나요? 오류가 발생한 행은 무엇입니까? 아니면 당신이 원하는 행동이 아니라는 것을 당신은 어떤 행동으로 봅니까? –