.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

not able to retrieve ref cursor value to .net

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :ASP.Net
 

Hi,

I am using oracle 9.2 ,odp.net 11.2 vs.net 2008,entlib 5.0 versions.

Here is my stored procedure.

CREATE OR REPLACE PACKAGE PKGENTLIB_SELECTTEMPDATA

as

TYPE T_CURSOR IS REF CURSOR;

procedure ENTLIB_SELECTTEMPDOCDATA

(

cur_OUT out T_CURSOR,

searchVal in varchar2

);

end;

CREATE OR REPLACE PACKAGE BODY

PKGENTLIB_SELECTTEMPDATA as

procedure ENTLIB_SELECTTEMPDOCDATA

(

cur_OUT out T_CURSOR,

searchVal in varchar2

)

is

begin

open cur_OUT for

select * from test;

end;

end;

Here is my code for .NET

public DataSet SelectStoredProc(string strSearch)

{

DataSet ds = new DataSet();

DBCommand dbCommand = db.GetStoredProcCommand("PKGENTLIB_SELECTTEMPDATA.ENTLIB_SELECTTEMPDOCDATA"); db.AddInParameter(dbCommand, "searchVal", DbType.String, strSearch);

try

{

ds = db.ExecuteDataSet(dbCommand);

}

catch (Exception ep)

{

string stp = ep.Message;

}

return ds;

}

When I run the above code, I am getting this error

{"ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to

'ENTLIB_SELECTTEMPDOCDATA' \nORA-06550: line 1, column 7:\n PL/SQL: Statem


View Complete Post


More Related Resource Links

Win32 Resources: Using C++ to Programmatically Retrieve a Global Cursor's Shape and ID

  

Getting global cursor information is useful when developing software that drives or gathers information about other UI-based applications, including information about a remote machine. This article describes a way to programmatically identify the current cursor's ID and bitmap at any point in time. The first technique described is based on polling for information and shows how to get the handle of the current global cursor. This handle will then allow you to get information about the cursor. You can also monitor WinEvents for changes to the global cursor.

Dmitri Klementiev

MSDN Magazine October 2001


Cursor Functions

  
A cursor allows looping through a record set and performing a certain operation on each record within the set. SQL Server supports three functions that can help you while working with cursors: @@FETCH_STATUS, @@CURSOR_ROWS and CURSOR_STATUS. Cursor functions are non-deterministic.

DECLARE CURSOR in Transact-SQL

  
Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions.

How to retrieve data from SqlDataSource and pass to a variable?

  

Hi there,

I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:

    <asp:SqlDataSource ID="sdsFormOrderDetails" runat="server" 
ConnectionString="<%$ ConnectionStrings:ForexDB %>"
ProviderName="<%$ ConnectionStrings:ForexDB.ProviderName %>"
SelectCommand="usp_GetOrderDetails" SelectCommandType="StoredProcedure"
UpdateCommand="usp_UpdateOrder" UpdateCommandType="StoredProcedure"
>
<SelectParameters>
<asp:ControlParameter Name="orderId" ControlID="grdOrders" PropertyName="SelectedDataKey.Value" />
</SelectParameters>
<UpdateParameters>
<asp:ControlParameter Name="orderId" ControlID="frmOrderDetails" PropertyName="SelectedValue" />
</UpdateParameters>
</asp:SqlDataSource>

How to retrieve image from DB with Linq and diplay in Image Control

  

Hi all-

 

I'm using the file upload to let the user upload a single file.  Here's the code I'm using to then upload to the DB.  How do I reverse this process and dowload the image into the control for it to display on a different page?

Here's my code for the upload - which I think works but can't confirm until I can see the download since all I see in the DB is "binary data"

'update DB with new Image 
        If FileUpload1.HasFile AndAlso FileUpload1.PostedFile.ContentLength > 0 Then
            'Read the file in to a byte Array.
            Dim filebyte As Byte() = FileUpload1.FileBytes
            Dim fileBinary As New System.Data.Linq.Binary(filebyte)
            Try
                Dim c3 = (From c In dc.ProductImages _
                          Where c.userID = userGuid _
                          Select c).FirstOrDefault

                c3.productImage = fileBinary
                dc.SubmitChanges()

            Catch ex As Exception
                Throw ex
            End Try
 
Here's my attempt at the retrieval, which isn't working:
Try
                    Dim currentImage = F

How to store and retrieve multiple values in a single session variable .

  

I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.


Programmatically retrieve data from the associated row in SharePoint and use the data to do math

  

I am trying to pull all of the associated data from a SharePoint list row to an InfoPath form repeating table.  I would like to select 1 unique value from the row and have the other fields auto-populate with the associated data from that row. 

Example:

SharePoint Columns and also names of InfoPath fields 1, 2, 3, 4, 5, 6, 7.

I have a dropdown that is connected to column 1 and I would like to select 1 and have it populate the rest of the fields from that row.  I am currently doing this with information and C# code from:  http://www.bizsupportonline.net/infopath2007/sharepoint-list-retrieve-value-same-row-repeating-table-infopath

How can i add a textbox into a GridView Cell dynamically and how can i retrieve entred data

  
Hey, i think that the the subject can explain what i need, it's about adding a TextBox control with the code behind into a GridView, and also about how can i retrieve entered data after submitting, im using C#,Thanks.

MDX statement to retrieve only one value

  
Hi all, SELECT [Measures].MEMBERS ON COLUMNS, NON EMPTY [0VENDOR].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0VENDOR].[20VENDOR] ON ROWS FROM [OPOMCHS0/ZQT_GPO_PO_CHNG_REP_SUMM_3] . The balove statement gives me all the values of the vendors. What if I want this statement to retrieve only a vendor called ABCD? Thanks in advance.  

SQL 2008 R2 (final): SSMS freezes: "Failed to retrieve data for this request.

  
The original thread is locked for some reason--but the cause of the bug had something to do with the "ssms tools pack" add-in, which, according to the comments in the connect item, will be fixed in an update of ssms tools: http://social.msdn.microsoft.com/Forums/en-US/sqlkjdatabaseengine/thread/f65737b7-fe4d-487b-aa41-ef437d100bc7 https://connect.microsoft.com/SQLServer/feedback/details/556169/ssms-completely-locked-up-after-right-clicking-a-table  

No Way to retrieve data from oracle ref:_cursor over T-SQL and linked Server?

  
Hello, for an migration projekt we want to compare results from sp's from oracle and sqlsserver. Same calls should retrieve same results. Also we want build an automatic test for this. But is there now way to retrieve results from oracle sp's whit rev_cursor over linked Server? No one answer to this: http://social.msdn.microsoft.com/forums/en-us/sqldataaccess/thread/2BAC6743-8701-4476-8F36-0377A5761525   greetings Michael

Retrieve and display pictures on form

  
I need to write a code to retrieve and display pictures on a form. And also a validation to disable next or previous button when reaching an end of the picture stream. Can anyone please help me  out ASAP? PS: All pictures should be located in a combo box! And the number of pictures are 200.

Retrieve the child ActivityContext from the Sequence activity

  
Hi all, I create my own sequence activity, which will report to DB. I would like to retrieve OutArgument from nested activity, but here is my problem - to access OutArgument I need child context. I would like to avoid adding to the children code responsible for raport to DB. Is this scenario (retrieve the child ActivityContext from the Sequence activity or something else) possible?

looking for CURSOR replacement

  
I got below solution from christa with cursor...could some one help me out without cursor solution.. here we are devloping WHERE clause... CREATE TABLE X (UID INT IDENTITY(1,1), COL_N VARCHAR(50), COL_V VARCHAR(50), COL_D VARCHAR(50)) INSERT INTO X VALUES ('S_NAME', 'AYAZ', 'VARCHAR(50)') INSERT INTO X VALUES ('S_ROLL', '10', 'DECIMAL(15, 0)') INSERT INTO X VALUES ('S_MARKS', '99', 'INT') INSERT INTO X VALUES ('S_SCHOOL', 'ZINQ', 'VARCHAR(100)') --SELECT * FROM X /*CURSOR*/ declare @n varchar(50), @v varchar(50), @d varchar(50) declare @sql varchar(max) set @sql = ' where ' declare mycur cursor for select col_N, col_V, col_D from X order by uid open mycur fetch next from mycur into @n,@v,@d while @@fetch_status = 0 begin set @sql = @sql + @n + ' = ' if @d like '%char%' set @sql = @sql + '''' + @v + '''' else set @sql = @sql + @v set @sql = @sql + ' and ' fetch next from mycur into @n,@v,@d end close mycur deallocate mycur set @sql = LEFT(@sql, len(@sql) - 4) print @sql --WHERE S_NAME = 'AYAZ' AND S_ROLL = 10 AND S_MARKS = 99 AND S_SCHOOL = 'ZINQ'

is there alternate solution for CURSOR?

  
/* CREATE TABLE X (UID INT, COL_N VARCHAR(50), COL_D VARCHAR(50)) INSERT INTO X VALUES (3, 'S_NAME', 'VARCHAR(50)') INSERT INTO X VALUES (5, 'S_ROLL', 'DECIMAL(15, 0)') INSERT INTO X VALUES (8, 'S_MARKS', 'INT') INSERT INTO X VALUES (9, 'S_SCHOOL', 'VARCHAR(100)') SELECT * FROM X CREATE TABLE Y (UID INT IDENTITY(1,1), S_NAME VARCHAR(50), S_ROLL DECIMAL(15, 0), S_MARKS INT, S_SCHOOL VARCHAR(100)) INSERT INTO Y VALUES ('AYAZ', 10, 99, 'ZINQ') SELECT * FROM Y CREATE TABLE Z (UID INT, COL_N VARCHAR(50), COL_D VARCHAR(50), COL_V VARCHAR(50)) */ DECLARE @vSQL NVARCHAR(MAX) DECLARE @UID INT DECLARE @COL_N VARCHAR(50) DECLARE @COL_D VARCHAR(50) DECLARE cur CURSOR FOR SELECT UID, COL_N, COL_D FROM X ORDER BY UID OPEN cur FETCH cur INTO @UID, @COL_N, @COL_D WHILE(@@FETCH_STATUS=0) BEGIN SET @vSQL = 'INSERT INTO Z (UID, COL_N, COL_D, COL_V) SELECT ' + CAST(@UID AS VARCHAR) + ',' + '''' + @COL_N + '''' + ',' + '''' + @COL_D + '''' + ',' + @COL_N + ' FROM Y ' EXEC SP_EXECUTESQL @vSQL PRINT @vSQL FETCH cur INTO @UID, @COL_N, @COL_D END CLOSE cur DEALLOCATE cur SELECT * FROM Z

Retrieve cube data directly from Relational database - is this possible?

  
I have a cube created in SSAS R2 2008. Now i would like to retrieve some data from this cube, using MDX language, and then to process it in Relational SQL database! Is this possible? I am new in SSAS, please help!  

Hide HoverMenuExtender when cursor is in an associated TextBox

  
Hi.I use HoverMenuExtenders on TextBoxes to display some info in certain cases (typically; "you did something wrong here" - messages). Thing is, I want the HoverMenuExtender to disappear when the cursor is in its associated TextBox (and the mouse is outside its borders). Right now the HoverMenuExtender is still visible when the user have placed the cursor in a TextBox to write even though the mouse pointer is outside the TextBox.Is this possible? Thanks for any input! 
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend