Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> problem retrieving data from session based temporary table
Oracle 9i.
I have a procedure that returns a refcursor. Prior to this I do some sorting using a temporary table. When I pick out chunks of code and execute in SQL Plus, all works well (get data). But if I call the procedure in SQL Plus, I don't get any rows. Using ADO in VB I get a message saying object doesn't exist.
Here's the block of code (I've missed out a lot eg exception handling) :
>>>>>>>>>>>>>>>>>>>>>
"Title",
"ID",
"Business_Group",
"Subject",
"Publish_Date",
"Employee_ID",
"Preferred",
"Surname",
substr(a.Article,1,300) "Article" from tblNews a left join tblLUSubject b on a.Subject_Code = b.Code inner join tblNewsDepartmentsLink d on a.ID = d.News_ID left join tblLUCorporateNewsApplic e on d.Business_Group_Code = e.Code left join tblLUDivision f on d.Division_Code = f.Code left join tblStaffDirectory c on a.Employee_ID = c.Employee_ID';
execute immediate 'insert into tbltmpNewsSearch ' || psql;
update tbltmpNewsSearch
set "Group_Order" = 2
where "Subject" <> '' or "Subject" is not null;
open pCursor for --this works (no need to use fetch with refcursors)
select "Title", "ID", "Business_Group", "Subject", "Publish_Date", "Employee_ID", "Preferred", "Surname", "Article"
commit; --empties table
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Thanks,
Paul
Received on Mon Apr 29 2002 - 23:01:37 CDT
![]() |
![]() |