sql - How do I load columns from different tables into a cursor and display them? -
i want display of rows in gametables, , display 1 of rows in howtoplay. have googled around cannot figure out how load columns 2 tables 1 cursor , display them.
using oracle 11g.
this stored procedure code:
procedure getlotterygame (lg_id in number, lg_ref out lotg_ref_cursor) begin open lg_ref select a.gamedetailsid,a.gamename,a.gamecost,a.gamedescription,a.wheretoplay,b.howtoplayinfo gamedetails inner bring together howtoplay b on b.gamedetailsid = a.gamedetailsid a.gamedetailsid >= lg_id; end getlotterygame;
this phone call procedure code:
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 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:
error study - ora-06550: line 17, column 143: pls-00103: encountered symbol "v_howtoplayinfo" when expecting 1 of following: ) , * & = - + < / > @ in mod remainder not rem => <an exponent (**)> <> or != or ~= >= <= <> , or like2 like4 likec between using || fellow member submultiset symbol "," substituted "v_howtoplayinfo" continue. 06550. 00000 - "line %s, column %s:\n%s" *cause: pl/sql compilation error. *action:
you forgot concat operator between ',' v_howtoplayinfo)
.
should ',' || v_howtoplayinfo)
.
by way, allowed break such long lines. if do, can read them without having scroll right, , more spot such errors yourself.
sql oracle
No comments:
Post a Comment