Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Oracle Reference Cursors using Enterprise Library

Posted on 2008-06-23
6
Medium Priority
?
1,747 Views
Last Modified: 2008-07-02
I have the trouble with the stored procedure returning ref cursor.

I used the code provided by Horst.

I have the same problem HELP!!!
I keep coming up with the same problem and cannot figure it out, any help would be appreciated.
--------------------------------------------------------------------------------

[WebMethod(Description = "Compare PriceList")]

publicDataSet ComparePriceListDelete(string OldPriceList, string NewPriceList, refstring Status)

{

string procedureName = "init_price.PRICE_LIST_REPORTING.price_list_deletions"; //schema.stored procedure



System.Data.DataSet DSNew = newDataSet();



Database db = DatabaseFactory.CreateDatabase("InitialPrices.Properties.Settings.ConnectionString");

DbCommand dbCommand = db.GetStoredProcCommand(procedureName);

db.AddInParameter(dbCommand, "p_old_price_list_id", DbType.String, OldPriceList);

db.AddInParameter(dbCommand, "p_new_price_list_id", DbType.String, NewPriceList);

db.AddOutParameter(dbCommand, "p_status", DbType.String, 255);

db.AddOutParameter(dbCommand, "p_delete_cursor", DbType.Object, 2000);

DSNew = db.ExecuteDataSet(dbCommand);

Status = dbCommand.Parameters[2].Value.ToString();

return (DSNew);



}


It returns invalid column 7.

here is my stored proc.

PROCEDURE price_list_deletions (cur_out IN OUT t_cursor,
p_old_price_list_id IN price_list_dtl.price_list_hdr_id%TYPE,
p_new_price_list_id IN price_list_dtl.price_list_hdr_id%TYPE,
p_status OUT NOCOPY varchar2)

IS
rec_count number := 0;
BEGIN
p_status := 'Success';
SELECT count(*) into rec_count
FROM (
SELECT grade_code_dtl_id
FROM price_list_dtl
WHERE price_list_hdr_id = p_old_price_list_id
MINUS
SELECT grade_code_dtl_id
FROM price_list_dtl
WHERE price_list_hdr_id = p_new_price_list_id);
If rec_count = 0 then
p_status := 'No Data';
OPEN cur_out
FOR
SELECT count(*)
FROM price_list_dtl
WHERE price_list_hdr_id = p_old_price_list_id
MINUS
SELECT count(*)
FROM price_list_dtl
WHERE price_list_hdr_id = p_new_price_list_id;
else
OPEN cur_out
FOR
SELECT grade_code_dtl_id
FROM price_list_dtl
WHERE price_list_hdr_id = p_old_price_list_id
MINUS
SELECT grade_code_dtl_id
FROM price_list_dtl
WHERE price_list_hdr_id = p_new_price_list_id;
end if;
EXCEPTION
WHEN others THEN
p_status := 'Failure: ' || SQLERRM;
END price_list_deletions;
0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 21858927

What is the COMPLETE error message?
0
 

Author Comment

by:mathieu_cupryk
ID: 21860676
this is solved.
0
 

Accepted Solution

by:
mathieu_cupryk earned 0 total points
ID: 21891277
the cursor must be the first parameter.

by DAAB.

this is the solution why it crashes.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 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…

719 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