Link to home
Start Free TrialLog in
Avatar of samir25
samir25

asked on

Urgent-Using Ref Cursors with ODP.net

hi
i have an asp.net page and the data i want to show in the grid i want to get from oracle. i can do that my creating logic on the page. but i wanted to separate the business logic to the database which will be faster also(than simply creating query on a webpage)

the query that i have in asp side is
select serialno, time, id, xml_data from tablename where status="error" and serialno="23455".

this record returns to me 200 rows. basically stored procedure will have have 2 IN parameters in their defination and I am not able to understand the OUT parameter. ALso I read on net if i use ref cursors then i can pass the address rather.

can someone suggest me on this?
Avatar of schwertner
schwertner
Flag of Antarctica image

Avatar of samir25
samir25

ASKER

http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html
i was reading this above article.
what is the impact of this characteristics
A ref cursor is not backward-scrollable. The data represented by the ref cursor is accessed in a forward-only, serial manner. You cannot position a record pointer inside the ref cursor to point to random records in the result set.

CAN I NOT DO SORTING/PAGING ON GRID then?
Your procedure could take the form:
And in the client application you can fetch from this ref cursor(arg3).

procedure <procedure name>(arg1 varchar2, arg2 varchar2, arg3 OUT sys_refcursor)
as
begin
open arg3 for
select serialno, time, id, xml_data
from tablename
where status= arg1 and serialno= arg2;
end;
/

You have to place the data in the grid.
Scrolling and pointing random row is
function of the grid, not of the select statement
and the procedure you use. It only deliveres the
data, nothing else.
You have to place the delivered data in
a scrolbar GUI, e.g. Oracle Forms or .asp page

Alternativelly you can also read page by page.
If you need the SELECT statement go to Oracle
magazine and read article from Tom Kyte how
to select page after page.
ASKER CERTIFIED SOLUTION
Avatar of anand_2000v
anand_2000v
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samir25

ASKER

i have used table type...wihtout fully knowing its concepts.i havent tried ref cursors so probably will try that out. just for clarification. table type concept is also pointers? bec i can pull data. the only reason why i want to opt for ref cursor is that i move to logic in my db and use pointers so that its faster
Cursors have no navigation.
Cursors can not paginate without additional eforts (writing appropriate SQL).

Normally these functionalities are delivered by the front end GUI. A good example is Oracle Forms, but every GUI nowadays is able to do this.

Instead jumping in complex Oracle functionalities pay attention to your GUI ...