Solved

how to bind the oracle store proc -CURSOR with sqldatasource -GRIDVIEW in asp.net 2.0, c#

Posted on 2008-10-27
5
916 Views
Last Modified: 2013-12-18
Hi,
I am having a SQLdatasource with a grid associated to it,
i need to change the SQL inline to a store procedure, i have written a store procedure
and taken input parameters as <selectparameters>

but i am not able to get data from cursor - getting errors.

I need syntax  for giving input and getting output variables from store proc -- in aspx.

it would be great help , if i can get a store proc as an example.

any articles please post the links .....
0
Comment
Question by:Swetha_aJaX
5 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 22992687
create package with a procedure in it with a sysrefcursor


you use the O_Results param as a dataset


CREATE OR REPLACE PACKAGE SCHEMA.PKG_EXPORT AS
 
  PROCEDURE ExportData(I_PARAM IN VARCHAR2, O_RESULTS OUT SYS_REFCURSOR);
 
END PKG_EXPORT;
/
 
CREATE OR REPLACE PACKAGE BODY SCHEMA.PKG_EXPORT AS
  PROCEDURE ExportData(I_PARAM IN VARCHAR2, O_RESULTS OUT SYS_REFCURSOR) AS
  BEGIN
    OPEN O_RESULTS FOR 
      SELECT * FROM TABLE
      WHERE PARAM IN I_PARAM; 
  END;  
END PKG_EXPORT;
/

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question