473,782 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Oracle Output Parmeter

Hi there,
I try to write out an oracle parameter from a stored procedure, but only
receive the name of the parameter. Here is what I do:

cmd.Parameters. Add(new OracleParameter ("confidential" ,
OracleType.Numb er)).Direction = ParameterDirect ion.Output;

then i just try this:

string strPageAccess = cmd.Parameters["page_acces s"].Value.ToString ();

which gives the error: Object reference not set to an instance of an object

Trying:
string strPageAccess = cmd.Parameters["page_acces s"].ToString();

Just gives out the parameter name.

What am I doing wrong? Thanks

Chris
Nov 17 '05 #1
1 1349
don't worry. I worked it out.

Thanksa guys. The code was right. I just forgot something els

"chris" wrote:
Hi there,
I try to write out an oracle parameter from a stored procedure, but only
receive the name of the parameter. Here is what I do:

cmd.Parameters. Add(new OracleParameter ("confidential" ,
OracleType.Numb er)).Direction = ParameterDirect ion.Output;

then i just try this:

string strPageAccess = cmd.Parameters["page_acces s"].Value.ToString ();

which gives the error: Object reference not set to an instance of an object

Trying:
string strPageAccess = cmd.Parameters["page_acces s"].ToString();

Just gives out the parameter name.

What am I doing wrong? Thanks

Chris

Nov 17 '05 #2

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

Similar topics

3
12686
by: Chad The Man | last post by:
I have been developing some applications on suse 9 / apache 1.37 / php 4.3.4 / Oracle 9i / OCI8. We recently moved servers, apache works fine, php works fine, oracle works fine... however, trying to connect to oracle from php it dies with the following error : Warning: ocilogon(): _oci_open_session: OCIHandleAlloc OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE Using SQL plus I can connect just fine. The variables are all set in apache and the...
5
2070
by: Amueerie | last post by:
this may seem a trivial question (as .net may have been solely developed for this purpose), but i'm not certain whether this is possible, i.e. is it possible to access an Oracle DB in .NET (and is it the same as accessing any other db - except for the connection string & object). What is mean is, can i use the same select statements, update statements with the orable database that i used with MSDE & SQL database? thank u all
1
4680
by: newhaven_lad | last post by:
Please could someone help, I have a Perl cgi script which works perfectly when run in a dos prompt, it connects to a database on my laptop and inserts a record. But when I use the internet browser to run the script it doesn't insert the record in the database or display any messages past the following line. $dbh=DBI->connect("DBI:Oracle:testdb",'alan', 'alan'); I have supplied the whole script below As you can see, it takes input...
12
9527
by: wenmang | last post by:
Hi, I am using following Oracle Proc-C compiler: Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006 (c) Copyright 2000 Oracle Corporation. All rights reserved. I like to use "long long" integer type(64 bit), but it seems that Oracle doesn't like it after execution, and giving me error code -1460, any idea about this? thx
5
7323
by: nicknack | last post by:
Hello. I have an oracle connection and I'm trying to run a stored procedure. The code for defining the parameters in C# is: ------------------------------ cmd.commandType = CommandType.storedProcedure; //Parameter 1: OracleParameter prm1 = new OracleParameter("c1",OracleDbType.VARCHAR2); prm1.Direction = ParameterDirection.Output; prm1.Value = '1';
7
20332
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
2
5710
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that value in my .net code Below is my .net code OracleParameter mbrid = new OracleParameter("RET_MBRID", OracleType.Number); mbrid.Direction = ParameterDirection.Output;
1
1838
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that value in my .net code Below is my .net code OracleParameter mbrid = new OracleParameter("RET_MBRID", OracleType.Number); mbrid.Direction = ParameterDirection.Output;
2
14250
by: Vinod Sadanandan | last post by:
All, Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze each of the listed features . Precompilers: Additional Array INSERT and SELECT Syntax Support by Pro*C/C++ and Pro*COBOL Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL Precompilers: Flexible B Area Length...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10076
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.