473,378 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Error while calling sp from C# code using oledb

Hi,
I am getting an error while executing a sp from Oracle database. Can you let me know what could be the problem?
here is the code

using(System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection())
{
cn.ConnectionString="Provider=OraOLEDB.Oracle;Pass word=STORED_OBJ;User ID=STORED_OBJ;Data Source=PDCDGL1.NA.HPFS.COM;Extended Properties=;Persist Security Info=False;PLSQLRSet=1;";
cn.Open();

//String strProcName = "{CALL pkg_product.SearchProd(?, ?, ?, ?, ?, ?, {resultset 0, CDFCursor})}";

String strProcName = "{CALL pkg_product.SearchProd(?, ?, ?, ?, ?, ?}}";
System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();
cmd.Connection = cn;
cmd.CommandText=strProcName;
cmd.CommandType=CommandType.Text;
cmd.Parameters.Add("mfrid",System.Data.OleDb.OleDb Type.Integer).Value=3;
cmd.Parameters.Add("prodtypeid",System.Data.OleDb. OleDbType.Integer).Value=1;
cmd.Parameters.Add("partnum",System.Data.OleDb.Ole DbType.VarWChar).Value=3;
cmd.Parameters.Add("descr",System.Data.OleDb.OleDb Type.VarWChar).Value="3";
cmd.Parameters.Add("active",System.Data.OleDb.OleD bType.VarWChar).Value="3";
cmd.Parameters.Add("langcode",System.Data.OleDb.Ol eDbType.VarWChar).Value="3";

//cmd.Parameters.Add("CDFCursor",System.Data.OleDb.O leDbType.VarWChar).Value="";

cmd.ExecuteReader();

cn.Close();
}

The stored procedure on the oracle database is as follows:
PROCEDURE SearchProd ( mfrid in number,prodtypeid in number,partnum in varchar2,descr in nvarchar2,
active in varchar2, langcode in varchar2,CDFCursor in out CDFCur)
Is
langcd varchar2(3);
begin
if langcode = ' ' then
langcd := 'eng';
else
langcd := langcode;
end if;

if langcd = 'eng' then
Open CDFCursor for
Select (to_char(pr.product_id) || '|' || langcd) primkey, mf.mfr_short_name mfr_short_name,
pr.part_number part_number, pr.short_desc short_descr,
langcd langcd, pt.product_type_value,
decode(ltrim(rtrim(pr.active_status_ind)),'Y',-1,0) active_status_ind
from product pr,manufacturer mf,product_type pt
where pr.mfr_id = mf.mfr_id and
pr.product_type_id = pt.product_type_id
and (pr.mfr_id = mfrid or mfrid = -1 )
and (pr.product_type_id = prodtypeid or prodtypeid = -1)
and (upper(pr.part_number) like upper(partnum) or partnum = ' ' or partnum is null )
and (upper(pr.short_desc) like upper(descr) or descr = ' ' or descr is null )
and (upper(ltrim(rtrim(pr.active_status_ind))) = upper(active) or active = ' ' or active is null );
else
Open CDFCursor for
Select distinct (to_char(pr.product_id) || '|' || langcd) primkey,ml.mfr_short_name mfr_short_name,
pl.part_number part_number, pl.short_descr short_descr,
pl.lang_cd lang_cd, pt.product_type_value,
decode(ltrim(rtrim(pr.active_status_ind)),'Y',-1,0) active_status_ind
from product pr,manufacturer mf,product_type pt,product_lang pl, mfr_lang ml
where pr.product_type_id = pt.product_type_id
and pr.product_id = pl.product_id
and pl.lang_cd = langcd
and pr.mfr_id = ml.mfr_id (+)
and ml.lang_cd (+) = langcd
and (pr.mfr_id = mfrid or mfrid = -1 )
and (pr.product_type_id = prodtypeid or prodtypeid = -1)
and (upper(pr.part_number) like upper(partnum) or partnum = ' ' or partnum is null )
and (upper(pl.short_descr) like upper(descr) or descr = ' ' or descr is null )
and (upper(ltrim(rtrim(pr.active_status_ind))) = upper(active) or active = ' ' or active is null );
end if;

end SearchProd ;

I get the following error "Unspecified error"
Jul 21 '05 #1
0 1863

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
1
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
4
by: Troy | last post by:
We recently installed the .Net framework on a windows 2000 server. Shortly after that we experienced intermitant problems running a web based program that accesses an Access 2002 database. The...
0
by: Manuel Arroba | last post by:
asp.net oledb command parameter error calling an as400 program Hi... I have an as400 program that I can call it directly and it works: variable= "xxxx" sql = "CALL METSIGOP.SIGOPRC ('" +...
3
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I...
5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
0
by: Error while executing SP | last post by:
Hi, I am getting an error while executing a sp from Oracle database. Can you let me know what could be the problem? here is the code using(System.Data.OleDb.OleDbConnection cn = new...
1
by: John | last post by:
Hi I have a perfectly working vs 2003 winform data app. All the data access code has been generated using the data adapter wizard and then pasted into the app. I had to add a new field in the...
4
ollyb303
by: ollyb303 | last post by:
Hi, wasn't sure whether I should post this under .net, IIS or access, but I've plumped for .net! I have a problem with an asp.net website which I am hosting on a windows server 2003 under IIS...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.