473,394 Members | 1,715 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,394 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 1299

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.