Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » How to use procedure with ref cursor
How to use procedure with ref cursor [message #680612] Mon, 25 May 2020 20:56 Go to next message
ducnt26
Messages: 10
Registered: April 2016
Location: Hanoi
Junior Member

Pls help!!! I have procedure that using a ref cursor, how could call it in APEX.
procedure TK_SPLITER( 
    id in number,
    V_RESULTS out SYS_REFCURSOR
  )
  as
  str varchar2(200);
  begin
   
    str := 'select a.name, a.address,b.long, b.lat
                from spliter a 
                left join coordinate b on a.id = b.id
                where a.category_id= 5
                ';
         if id > 0 then
            str := str || ' and a.id = ' ||id ;
         end if;        
         
        dbms_output.put_line(str);
        open v_results for str;
  end;
Re: How to use procedure with ref cursor [message #680616 is a reply to message #680612] Tue, 26 May 2020 03:13 Go to previous messageGo to next message
AdrianWard
Messages: 21
Registered: September 2019
Junior Member
Hi

Where are you trying to use this Procedure?

It seems like a simple query, could you not put in straight into the APEX region that uses it?

Cheers
Adrian
Re: How to use procedure with ref cursor [message #680620 is a reply to message #680616] Tue, 26 May 2020 05:03 Go to previous message
ducnt26
Messages: 10
Registered: April 2016
Location: Hanoi
Junior Member

I have a lot complex procedures, that is a simple example. These procedures will provide reports with many columns.

[Updated on: Tue, 26 May 2020 05:04]

Report message to a moderator

Previous Topic: Making select list - display and return values
Next Topic: Serving APEX images from the Oracle CDN
Goto Forum:
  


Current Time: Wed Dec 11 14:20:30 CST 2024