We help IT Professionals succeed at work.
Get Started

Oracle Stored Procedure, Returning Ref Cursor Help

jmpatton
jmpatton asked
on
729 Views
Last Modified: 2013-12-19
Hello,

I am wanting to return a set of records from a stored procedure back out to my web service.  I am sending in a parameter, running the query off that parameter and need to return th resulting recordset.  However, it will not compile.  Any help would be appreciated.  Thanks
CREATE OR REPLACE PROCEDURE get_conflict_points(psourcepipelinenumber IN VARCHAR2,   result_cursor OUT) AS

BEGIN

  OPEN result_cursor FOR

  SELECT a.station,
    a.station_piping_junction,
    psourcepipelinenumber AS
  current_pipeline_to_check,
    c.pipeline,
    c.ps_nass_pipeline
  FROM sch_cor_stations a,
    sch_fie_pipelines b,
    sch_fie_pipeline_sources c
  WHERE a.pipeline = psourcepipelinenumber
   AND a.station_piping = 1
   AND a.station_piping_scheduled = 1
   AND b.junction = a.station_piping_junction
   AND b.tank_scheduling_station = a.station
   AND b.has_pipeline_sources = 1
   AND c.ps_nass_station = a.station
   AND c.ps_nass_pipeline <> psourcepipelinenumber
  ORDER BY a.order_number;

END get_conflict_points;

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE