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(str
ing OldPriceList, string NewPriceList, refstring Status)
{
string procedureName = "init_price.PRICE_LIST_REP
ORTING.pri
ce_list_de
letions"; //schema.stored procedure
System.Data.DataSet DSNew = newDataSet();
Database db = DatabaseFactory.CreateData
base("Init
ialPrices.
Properties
.Settings.
Connection
String");
DbCommand dbCommand = db.GetStoredProcCommand(pr
ocedureNam
e);
db.AddInParameter(dbComman
d, "p_old_price_list_id", DbType.String, OldPriceList);
db.AddInParameter(dbComman
d, "p_new_price_list_id", DbType.String, NewPriceList);
db.AddOutParameter(dbComma
nd, "p_status", DbType.String, 255);
db.AddOutParameter(dbComma
nd, "p_delete_cursor", DbType.Object, 2000);
DSNew = db.ExecuteDataSet(dbComman
d);
Status = dbCommand.Parameters[2].Va
lue.ToStri
ng();
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%TYP
E,
p_new_price_list_id IN price_list_dtl.price_list_
hdr_id%TYP
E,
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;
Start Free Trial