Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2004, 02:56 PM
Registered User
 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oracle Stored Procedure - wrong number of params

Hello, I am trying to learn how to use stored procedures within the .Net environment.

I have been successful in calling a stored procedure with a "REFCursor", and NO input parameters, but when I attempt to call a stored procedure with a single input parameter and an output parameter with a type of "REFCursor", I always get the same error - wrong number of parameters or wrong datatypes. I do not believe either is true, but what can I say, I must be missing something.

Here is my Oracle Procedure (I have successfully executed it SQL+)
PROCEDURE QRY_PRODUCT_CODES( i_User_ID IN INT,
                                o_Rows OUT t_cursor)
  IS
  BEGIN
         IF i_User_ID is null THEN
               OPEN o_Rows FOR
             select op.Product_id,
                 op.name
             from TST_OPS_product op, TST_OPS_product_family opf
             where op.FAMILY_ID = opf.FAMILY_ID
               and op.MCC_Sort_ord is not null
            and ( op.prod_mgr1_id = i_User_ID
                 or op.prod_mgr2_id = i_User_ID
                 or op.grp_mgr_id = i_User_ID
                 or op.PDM_Contact1_ID = i_User_ID)
          order by op.Name;
       ELSE
              OPEN o_Rows FOR
           select op.Product_id,
                     op.name
           from TST_OPS_product op, TST_OPS_product_family opf
           where op.FAMILY_ID = opf.FAMILY_ID
             and op.MCC_Sort_ord is not null
           order by op.Name;
       END IF;
  END QRY_PRODUCT_CODES;

Here is the code that I use to create my parameters....

parm = new Oracle.DataAccess.Client.OracleParameter("o_Rows", Oracle.DataAccess.Client.OracleDbType.RefCursor);
parm.Direction = ParameterDirection.Output;
cmd.Parameters.Add(parm);

parm2 = new Oracle.DataAccess.Client.OracleParameter("i_User_I D", Oracle.DataAccess.Client.OracleDbType.Int32);
parm2.Direction = ParameterDirection.Input;
parm2.Value = 53;
cmd.Parameters.Add(parm2)

I have tried all kinds of "OracleDbType" for the "i_User_ID", such as int16, single, double, decimal....but not luck, same error.

Why does it not like my parameters?






Similar Threads
Thread Thread Starter Forum Replies Last Post
.net with oracle stored procedure vgsgowrisankar C# 2005 1 April 16th, 2008 03:14 PM
Oracle Stored Procedure life.gurpreet C# 2005 0 March 13th, 2007 04:54 AM
Calling an Oracle Stored Procedure booksnore2 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 October 1st, 2004 09:35 AM
Stored Procedure hits wrong index ashettleroe SQL Server 2000 6 June 30th, 2004 05:28 PM
arrays and stored procedure in oracle Munawwar Oracle 1 March 12th, 2004 04:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.