output record sets with cursors
I have a dimela where my PL/SQL script does not return any rows. Please understand that I am not running this in SQL PLUS , so I cannot use DBMS_OUTPUT package and I cannot select into variables because I am actually migrating data to SQL SERVER from Oracle using DTS. Here is my script:
DECLARE
current_date Date;
TYPE rst_refcur IS REF CURSOR;
p_rec rst_refcur;
BEGIN
current_date := SYSDATE;
OPEN p_rec FOR
select a.wprptsta, a.wpitem, a.wpitmseg, a.mandisdv, a.conclass, a.wpwkmix, a.itsegman,
a.wpitemno, a.contydot, a.geodist,a.wpitstat, a.localnam, a.locatnfm, a.locatnto, a.isghstdt,
a.effdate, a.efftime, a.ffisyrcp, g.itmseg gis_itmseg from wpguser.wpgtbl80 a, wpguser.gis_wpgtbl80 g
where a.geodist = '04'and a.isghstdt = current_date
and a.wprptsta = g.wprptsta(+) and a.wpitem = g.wpitem(+) and a.wpitmseg =g.wpitmseg(+);
END;
This gives me a No data returned error, which I can see why, but since I am crossing platforms from my source (Oracle) and my destination (SQLServer) through DTS, I don't see how I can define it.
Please help.Thanks. If anyone knows or has links on how to do this migration , please let me know.
dev
Re: output record sets with cursors
Does the query return any rows if you run in sqlplus?
no rows returned in sql plus
Thanks for the reply...no rows are returned, should there be some returned?