473,387 Members | 3,820 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,387 software developers and data experts.

Error while executing sp from c# against Oracle database

Hi,
I am getting "Unspecified error"

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();
}
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 ;

Jul 21 '05 #1
0 1297

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

Similar topics

2
by: Naren | last post by:
Hi, I am a newbie to Oracle and stored procedures. Hence this question comes up. The complete scenario is like this. We have a multithreaded application using pthreads on HP-UX machine. We are...
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...
0
by: Error while executing SP | last post by:
Hi, I am getting "Unspecified error" using(System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection()) {...
0
by: rajkalacbe | last post by:
I am running a visual basic executable program through Forms4.5 of D2K using Forms menu options.. When I Invoke this form in the server where I have the database installed, I do not have any...
2
by: alex | last post by:
I'm executing this code against an Oracle connection. The SQL works perfectly under an ORACLE console, but fails when executing it from the PHP script. I hope someone can give me a guiding light...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
2
by: devas | last post by:
Hai, Issue: I am using OEM 10g grid control. I want to establish the connection from oracle to sql server=>I can’t able to connect it. Please help me I have created the system dsn below steps....
5
by: ph3ng | last post by:
Hi I was executing sp_help on a server (ran against master database) and i get the following message: Associated statement is not prepared(HY007) Anyone got any idea what is wrong?
15
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.