Procedure Help with Powerbuilder
861624May 12 2011 — edited May 16 2011Hello,
I am having a very hard time getting this procedure to work. I am trying to create a procedure to call from a powerbuilder datawindow.
using oracle 10, and powerbuilder 11
The procedure retrieves data into a cursor,
inserts data into a global temp table.
Select from temp table for powerbuild to view in a datawindow.
When I run the datawindow I get a message "Select Error: ORA-00003: Message 3 not found; Product=RDBMS; facility= ORA"
Any Help would be great.
This is a dumbed down version of my procedure but it still give me the error I am having problems with.
I have verified that data is being inserted into my global temp table.
when I add the Ref Cursor "OPEN RC1 FOR Select port_id, arrive_date, depart_date, voyage_id From mll_tmprpt_portlist;"
Thats when it stops working.
I also have a link to sybase that also give me some examples
( http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc37776_1110/html/connpb/connpb134.htm )
I have a global temp table declared
Create global temporary table mll_tmprpt_portlist
( Port_ID Number,
Arrive_date Date,
Depart_date Date,
Voyage_ID Number)
on commit preserve rows;
Initially had delete rows.
MY Package
CREATE OR REPLACE package MLL_UTIL_pkg IS
type rcplst IS REF CURSOR Return mll_tmprpt_portlist%ROWTYPE;
END;
MY Procedure
CREATE OR REPLACE PROCEDURE MLL_test ( ad_BegDate DATE,
ad_EndDate DATE,
adb_deptid NUMBER,
RC1 in out MLL_UTIL_pkg.rcplst)
AS
CURSOR cur_ports IS SELECT VOYAGE_ID,
VOYAGE_LEG,
CURRLAST_PORT_ID ,
REPORT_DATE ,
CASE REPORT_TYPE
WHEN '4ARRIVE' THEN 'A'
WHEN '2DEPART' THEN 'D'
ELSE ' '
END AS RPT_TYPE
FROM MLL_RPT_DATA
WHERE REPORT_DATE between ad_BegDate AND ad_EndDate
AND REPORT_TYPE IN ('4ARRIVE', '2DEPART' )
AND DEPTID = adb_deptid
order by report_date asc;
BEGIN
-- Just looking to work and return something at this point.. removed excess code.
FOR Rec IN cur_ports
LOOP
DBMS_OUTPUT.PUT_LINE ('rec :' || Rec.CURRLAST_PORT_ID );
DBMS_OUTPUT.PUT_LINE ('Insert' );
Insert into mll_tmprpt_portlist values ( Rec.CURRLAST_PORT_ID, rec.REPORT_DATE, rec.REPORT_DATE, rec.VOYAGE_ID);
END LOOP;
OPEN RC1 FOR Select port_id, arrive_date, depart_date, voyage_id From mll_tmprpt_portlist;
END;