473,385 Members | 1,620 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,385 software developers and data experts.

how to execute oracle stored procedure in C#

Hi

I was struck up with big problem of executing a oracle stored procedure in C#.

Inputs 1:I am having 1 oracle stored procedure eg. myProc() and this procedure takes 1 INOUT parameter. of type stirng/varchar
problem description: I am not able to execute this procedure through my C# code.

for more information, below is the C# code that i am using......
Expand|Select|Wrap|Line Numbers
  1. OracleConnection con = new OracleConnection(StrConnectionString);
  2. con.Open();
  3. OracleCommand cmd = new OracleCommand("sapncdb.encrypt_field", con);
  4.       cmd.CommandType = CommandType.StoredProcedure;
  5. OracleParameter inval = new OracleParameter("inval", OracleType.VarChar);
  6.       inval.Direction = ParameterDirection.InputOutput;
  7. inval.Value = "13-4186423     ";
  8. cmd.Parameters.Add(inval);
  9. cmd.ExecuteNonQuery();
  10. Response.Write("return value is "+ inval.Value);
  11.  
Please help me out in getting the procedure execute in my C# code.

thanks in advance
Raj
Jun 11 '09 #1
3 11761
PRR
750 Expert 512MB
Are you getting any errors? did you try to execute your stored procedure from query analyzer (equivalent in Oracle )...
Link
Jun 12 '09 #2
Hi DeepBlue

Thanks for your reply.

Ya i am able to execute the same procedure from sql prompt.

and while executing from stored procedure i am getting below error message

ORA-06550: line 1, column 15:
PLS-00905: object SAPNCDB.ENCRYPT_FIELD is invalid
ORA-06550: line 1, column 7:

where SAPNCDB.ENCRYPT_FIELD is my stored procedure name


did u find any mistake in my code of executing the stored procedure? if so plz let me know.

Thanks in advance....

Raj
Jun 16 '09 #3
Hi All

Now i am able to execute my stored procedure.

I found the exact problem. and it is giving schema name before stored procedure name in command text.

i removed schema and executed and worked fine.

Thank you one and all for giving your valuabel solutions.

Regards
Raj
Jun 16 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: godwin | last post by:
Hi, I would like to execute an oracle stored procedure using the any oracle database module which satisfies the Database Specification standard. I have tried cxOracle and Odbc database packages...
2
by: Matt | last post by:
I want to exexute stored procedure in ASP, but it has error "Microsoft VBScript compilation (0x800A0401) Expected end of statement" on line (1). The stored procedure "sp_emp" contain "select *...
1
by: robin via SQLMonster.com | last post by:
I've tried several different way to execute a oracle stored procedure from a DTS package but to no avail. I have a Linked Server setup which does bring back Oracle tables from the server when I...
3
by: Russell Verdun | last post by:
From a vb.net application I'm want to execute an Oracle Stored Procedure via a web service. What would be the best way to approach this? I can't pass and Oracle Command or the parameter objects...
2
by: Christine.Misseri | last post by:
Hi all, I'm sure someone knows about this problem. I have an Access database designed in Access 2000, connected to an ORACLE 8i back end. On the ORACLE side I have stored procedures, triggers...
1
by: Chad | last post by:
Hi, I am a SQL Server programmer using Oracle for the first time. In our .NET client apps which use a SQL Server back end, we would use Stored Procedure exclusively for all database access for...
0
by: Brew | last post by:
Hello, I'm writing an ASP.NET 2005 (VB) Website with an Oracle 9i backend I have an oracle package with stored procedures and functions I need to use from the VB Code, I'm trying to use the...
0
by: Tom | last post by:
Looking for some help with stored procedure call issues. Conceptually, I need to pass a data structure as the sole parameter to the Oracle stored procedure. Sounds simple enough....but how? ...
14
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but...
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: 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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.