?
Solved

adp.net executescalar usage example request

Posted on 2007-08-07
3
Medium Priority
?
1,060 Views
Last Modified: 2013-12-18
I've written a dab type oracle helper class using adp.net 10.0.2.  I'm writing the test harness and documentation for it right now.  I'm looking for an example of a pl/sql stored procedure to return a single value.
for example in a text version I'm using "select count(*) from regions" and that works for
result =  cmd.ExecuteScalar.(OracleCommandType.Text,MyText);
How do I do this same thing in a pl/sql stored procedure? I want to use the function
result = cmd.ExecuteScalar.(OracleCommandType.Storedprocedure,MySProcName);
0
Comment
Question by:gjutras
3 Comments
 
LVL 6

Author Comment

by:gjutras
ID: 19649543
btw, because this is for a test case and library, I already have versions using out parameters.  I can't use them for this.
0
 
LVL 22

Accepted Solution

by:
JimBrandley earned 1600 total points
ID: 19650994
In Oracle, I do not believe it is possible to have a return value (other than a OUT or IN OUT parameter) from a PROCEDURE. You might try using a function, such as:
CREATE OR REPLACE FUNCTION TestReturnValueToExecuteScalar( pInput VARCHAR) RETURN VARCHAR IS
BEGIN
   RETURN pInput;
END TestReturnValueToExecuteScalar;
/

and see if you can invoke it with ExecuteScalar. I have not tried that.

Jim
0
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 400 total points
ID: 19654040
I second that:  Procedures in Oracle do not have a return value.  You have to use OUT parameters.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question