URGENT: CLOB as output parameter for stored proc

HELP
I am unable to execute a stored procedure which has a CLOB defined as an output parameter from my Java code. It executes just fine from the SQL Plus promt.
When I try to run it through JDBC I get a PLS-00306 error.
I am using the Thin JDBC driver. When I try to compile using the OCI driver, I get class not found compile errors trying to import oracle.sql.*.
Thanks!
Donna J. Polk

The oracle.sql.* classes are part of the Oracle JDBC Driver.
Update your CLASSPATH variable to include $ORACLE_HOME/jdbc/lib/classes12_01.zip for JDK 1.2 or $ORACLE_HOME/jdbc/lib/classes111.zip for JDK 1.1.x

Similar Messages

  • SQL Statement as Parameter for Stored Proc

    This works fine in SQL script, but doesn't work when converting the script to a sp.  It doesn't like how I've defined the @PeriodEndDate parameter.  How do I set the variable to the results of a SQL statement?
    CREATE PROCEDURE usp_ARAging 
    -- Add the parameters for the stored procedure here
    @FiscalYear int = 2014, 
    @FiscalPeriod int = 5,
    @PeriodEndDate date = (SELECT MAX(JEDate) FROM ERPSQL01.EpicorNamg905.Accounting.Dim_JEDate
    WHERE FiscalYear = @FiscalYear
    AND FiscalMonth = @FiscalPeriod)
    Kirk P.

    Let's start over.  The default value of a procedure argument is a "suggestion" - a value to be used when it is not provided by the caller.  So is your goal to allow the user to supply any date, not just the one that coincides with the
    fiscal year and period values?  IF not, then it should not be a parameter and the value should be determined by the code inside the stored procedure. 
    However, if your goal is to allow any value, then you must follow the rules for specifying an appropriate default and those rules are very restrictive.  You cannot use a query nor can you refer to other parameters.  The typical approach is to use
    a "marker" value which the caller uses to indicate that it wants to use the true "default" value which you would then determine inside your stored procedure.  Often a value of NULL is used; in your procedure the code checks this parameter
    for a null value and, if found, assigns it the value you used in your query above.
    And while we're at it, you should code defensively and check that the set of values supplied as parameters are consistent with each other and with the logic that depends on them.  For example, presumably the period argument should be between 1 and 12
    (and not null).  I suggest you reconsider the use of integers since the domain of these values FAR EXCEEDS that allowed for years and months for most business purposes.

  • Is it possible to pass TABLE as the output parameter in stored procedure

    Hey Experts,
      Is it possible to pass TABLE as the output parameter in stored procedure.
    eg
    create procedure spGetData
    @tableName as TABLE(intValue INT NOT NUL)
    as 

    You can use OPENQUERY or OPENROWSET, as mentioned above, to make stored procedure results table like. There are
    some limitations with these methods:
    http://technet.microsoft.com/en-us/library/ms188427.aspx
    In OPENQUERY this-sql-server-instance can be used instead of a linked server name. It requires setting data accces server option:
    exec sp_serveroption @server = 'PRODSVR\SQL2012'
    ,@optname = 'DATA ACCESS'
    ,@optvalue = 'TRUE'
    LINK: http://www.sqlusa.com/bestpractices/select-into/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Is it possible to pass array of strings as input parameters for stored proc

    Dear All,
    I wrote a Stored Procedure for my crystal report. now i got a modification.
    one of the parameters 'profit_center' should be modified so that it is capable to take multiple values.
    now when i run report crystal report collects more than one values for parameter profit_center and sends it as input parameter to stored procedure all at a time.
    the only way to handle this situation is the input parameter for stored procedure 'profit_center' should be able to take array of values and i have a filter gl.anal_to = '{?profit_center}'. this filter should also be modified to be good for array of values.
    Please Help.

    Or you can use sys.ODCIVarchar2List
    SQL> create or replace procedure print_name( In_Array sys.ODCIVarchar2List)
        is
        begin
                for c in ( select * from table(In_Array) )
                loop
                        dbms_output.put_line(c.column_value);
                end loop ;
        end ;
    Procedure created.
    SQL>
    SQL> exec print_name(sys.ODCIVarchar2List('ALLEN','RICHARD','KING')) ;
    ALLEN
    RICHARD
    KING
    PL/SQL procedure successfully completed.SS

  • Using Statement rather than CallableStatement for stored proc execution

    Cleary, if you need to extract output parameters from a stored procedure, then you must use a CallableStatement to execute it. However, if your stored procedure just returns a basic ResultSet, or performs a database update, is there any penalty to using a regular Statement to execute the stored procedure?
    For example -
    String sql = "exec testprocedure 'param1' 'param2'";
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery( sql );
    vs.
    CallableStatement cs = conn.prepareCall( "{call testprocedure(?,?)}" );
    cs.setString( 1, "param1" );
    cs.setString( 2, "param2" );
    ResultSet rs = cs.executeQuery();
    Any thoughts?

    Any thoughts?You would have to look at the actual driver code for a sure answer.
    But for any real database (which a stored proc suggests) I doubt there would be any difference at all. It would resolve to the same call.

  • Omiting parameters for stored procs

    Post Author: lihaze
    CA Forum: Data Connectivity and SQL
    Hi - I hope that this is a straightforward one..  I have a number of params in a shared stored proc (they do default to NULL, but the app that I am using to call Crystal firstly cannot pass in a NULL value(!!!), and also always asks for the same no. of params that are in the creport. So, I am using Crystal 8.5, I dont even want these params to be requested. How can I make sure that they arent requested in Crystal?thanks

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    to actually pass a null value using crystal reports you will have to use crystal 2008as this isn't what you are after the alternative would be to in your report edit the parameter from the stored procedureput in a value, set the default value to that value and change allow custom value to falsethis will push the default value to the parameter every single time the report is run so you will not be prompted for the parameter value anymore

  • OUTPUT parameter for even handler

    Hi,
    Does any body know why Forte doesn't allow OUTPUT parameter type for even
    handler?
    Thank you,
    Minh Le,
    Software Engineer
    Mercury Interactive Corp.

    See the example in this recent posting. To get data from a subpanel, use Get Control Value or Get Control Value [Variant].

  • How to get RECORD data in output parameter of stored procedure

    I would like to return some data through RECORD structure from stored procedure.
    I have defined the RECORD as below:
    type ShipmentStatus is record(
    Booked integer,
    OnWater integer,
    OnRoad integer,
    InAir integer,
    OnRail integer,
    InWarehouse integer,
    Idle integer);
    the stored procedure is defined as
    create or replace procedure SP_MC_GET_SHIPMENT_STATUS
    iCustId in nvarchar2,
    oResult out ShipmentStatus
    I can get result in Sql*plus or PL/SQL developer, but I failed in get the result in Toplink.
    How can I get the output result, and convert it to an ENTITY by Toplink?
    Could you give me some advices on how to do mapping, how to call the stored procedure etc.., or code snip?
    Your answer is deeply appreciated. :)

    I'm not sure it is possible to get the PL/SQL record type through JDBC. Please try to access this procedure through JDBC to see if it is possible.
    You may need to convert the record type, to an object-type, i.e. wrap the procedure in another procedure that converts the record type. You could also just wrap the procedure in another that expands the record values into individual output parameters.

  • Help: Trying to pass a parameter to stored proc from FORMS

    I am working on a FORMS based on stored procedure with 7 parameters. All parameters work except p_sort for ORDER BY CLAUSE.
    Any suggestions?
    Thank you in advance.
    Jimmy

    pls post some more details .

  • Input and output parameter for subpanels

    Hi,
    i'm creating a measurement configuration tool within LabVIEW and i want
    to use subpanels for the several inputs/outputs (analog, digital...).
    The configuration data is hold within a data storage (variant) and
    contains all needed configuration parameters. Now i placed a subpanel
    control and needed stuff inside the block diagram of the wizard and i'm
    able to run it. Changes i made in that subpanels are lost currently
    because i'm not able to retrieve the output (connector) of the selected
    subpanel.
    Is there a way to exchange data over the connectors of the vi or do i
    have to use global variables in such a case? I hope i can avoid this.
    Thanks
    Henrik

    See the example in this recent posting. To get data from a subpanel, use Get Control Value or Get Control Value [Variant].

  • BizTalk Stored Proce-passing XML as one of the Input parameter and String as another parameter

    I have a requirement in BizTalk that
    - I will receive XML from Source and i need to submit this XML data and two other string parameters in  SQL storeprocedure  as a parameters and submit data
    Ex: My_SP(myID Integer INPUT,myXML xml Input,mystring OUT)
    Could you please help me how call storeprocedure and submit multiple parameters in BizTalk.

    you can execute stored procedure by generating schemas from WCF-SQL Adapter.
    for passing parameters you will have to do the mapping to the Generated schema for Stored proc.
    I would suggest to do this in Message Assignment shape, there you can easily assign all the parameters.
    Integer and String parameters can be assigned from normal variables and XML parameter can be inserted as suggested by Abhishek-
    xmldoc=requestMsg;
    varOuterstring=xmldoc.Outerxml.Tostring();
    Please refer the below article.
    https://www.packtpub.com/books/content/new-soa-capabilities-biztalk-server-2009-wcf-sql-server-adapter
    http://msdn.microsoft.com/en-us/library/dd787968.aspx
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • Parse parameter of Stored Procedure

    <p>Hi,</p><p>I have a date(P_INDATE) parameter in the report which is included as a part of IN parameter from Stored Proc,  Now in the report can I parse that parameter with any other String parameter?<br />For eg:<br />(if isnull({?P_INDATE}) then Datetime({?RPT_DATE}) = {?P_INDATE})</p><p>The root cause of the above turnaround is: I am unable to pass date datatype from java code to schedule report...</p><p>Any suggestions?</p>

    Please re-post if this is still an issue to the Java Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • VARRAY as Stored Proc output parameter

    VARRAY as Stored Proc output parameter
    I have an Oracle VARRAY data type declared as follows:
    CREATE TYPE NUMBER_ARRAY AS VARRAY(100) OF NUMBER;
    I have a stored procedure which takes a single input and
    returns a NUMBER_ARRAY as output:
    CREATE OR REPLACE PROCEDURE one_in_number_array_out(
    IN_PARAM IN NUMBER,
    OUT_NUMBER_ARRAY OUT NUMBER_ARRAY )
    IS
    BEGIN
    -- OUT_NUMBER_ARRAY getting populated here
    END one_in_number_array_out;
    I want to be able hit this proc using TopLink StoreProcedureCall objects and retrieve through a map.
    I thought I would be able to do something like:
    public void execute() {
         StoredProcedureCall call = new StoredProcedureCall();
              call.setProcedureName( getStoredProcedureName() );
              call.addNamedArgumentValue("IN_NUMBER_PARAM", new Double(324) );
              call.addNamedOutputArgument("OUT_NUMBER_ARRAY", "numberArray"); // use an alias
         ClientSession clientSession = .....getClientSession();
    // EXCEPTION OCCURS on following call:
              Map row = (Map) clientSession.executeSelectingCall( call ).firstElement();
              Object numberArray = row.get( "numberArray" );
              System.out.println("numberArray = " + numberArray);
    But, when I call the stored proc I get the following stack trace:
    LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'ONE_IN_NUMBER_ARRAY_OUT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'ONE_IN_NUMBER_ARRAY_OUT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ERROR CODE: 6550
         at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
         at oracle.toplink.threetier.ServerSession.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelect(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.ReadQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.threetier.ServerSession.internalExecuteQuery(Unknown Source)
         at oracle.toplink.threetier.ClientSession.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeSelectingCall(Unknown Source)
         at com.gs.lab.rr.db.plsql.gs_practice_pkg.OneInNumberArrayOutStoredProcedure.execute(OneInNumberArrayOutStoredProcedure.java:51)
         at com.gs.lab.rr.db.plsql.gs_practice_pkg.PracticeStoredProceduresTest.testOneInNumberArrayOutStoredProcedure(PracticeStoredProceduresTest.java:54)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:329)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)
    INTERNAL EXCEPTION STACK:
    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'ONE_IN_NUMBER_ARRAY_OUT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
         at oracle.toplink.threetier.ServerSession.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelect(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.ReadQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.threetier.ServerSession.internalExecuteQuery(Unknown Source)
         at oracle.toplink.threetier.ClientSession.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeSelectingCall(Unknown Source)
         at com.gs.lab.rr.db.plsql.gs_practice_pkg.OneInNumberArrayOutStoredProcedure.execute(OneInNumberArrayOutStoredProcedure.java:51)
         at com.gs.lab.rr.db.plsql.gs_practice_pkg.PracticeStoredProceduresTest.testOneInNumberArrayOutStoredProcedure(PracticeStoredProceduresTest.java:54)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:329)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)
    Thanks in advance,
    John

    Using the SQL/ObjectRelational types as stored procedure arguments is not supported. But it may work...
    You should not pass in the reference to the array type. Instead, do something like this:
    call.addNamedOutputArgument("OUT_NUMBER_ARRAY", "OUT_NUMBER_ARRAY");
    Hope this helps. If not, I suspect it would take some technical services to do this as I don't think the source.zip contains the classes involved in this.
    - Don

  • Calling Stored Procedure with Boolean Output Parameter

    Hi all,
    I'm running into an issue (or is it a BUG) when calling a Database Stored Procedure that has an output parameter of the boolean type.
    procedure proc(p_text in varchar2, p_result out boolean)
    is
    .....I use the following 'standard' code (developer guide 36-19 36-20) to invoke this procedure from my application module.
            try {
                // 1. Define the PL/SQL block for the statement to invoke
                String stmt = "begin proc(?,?); end;";
                // 2. Create the CallableStatement for the PL/SQL block
                st = getDBTransaction().createCallableStatement(stmt, 0);
                // 3. Register the positions and types of the OUT parameters
                st.registerOutParameter(2, Types.BOOLEAN);
                // 4. Set the bind values of the IN parameters
                st.setObject(1, "Some text");
                // 5. Execute the statement
                st.executeUpdate();
                ..............................As soon as 'st.registerOutParameter(2, Types.BOOLEAN);' is invoked I run into a SQLexception. "Invalid ColumnType: 16". Obviously 16 refers to Types.BOOLEAN.
    [edit by Luc]
    SOLUTION / WORKAROUND
    To answer my own question.
    It looks like BOOLEAN output parameters are not supported. I just Read "Appendix D Troubleshooting" of the Oracle® Database JDBC Developer's Guide and Reference 10g Release 2 (10.2).
    I found that JDBC drivers do not support the passing of BOOLEAN parameters to PL/SQL stored procedures. If a PL/SQL procedure contains BOOLEAN values, you can work around the restriction by wrapping the PL/SQL procedure with a second PL/SQL procedure that accepts the argument as an INT and passes it to the first stored procedure. When the second procedure is called, the server performs the conversion from INT to BOOLEAN.
    I'm not very happy with this but I guess I've no choice.
    Regards Luc
    Edited by: lucbors on Nov 30, 2010 10:37 AM

    fyi
    Related to the solution/workaround posted by Luc.
    see "Do Oracle's JDBC drivers support PL/SQL tables/result sets/records/booleans? "
    at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#34_05
    regards
    Jan Vervecken

  • How to check for null value of output parameter?

    Hi guys, I get a test procedure with 2 output parameters and do nothing:
    CREATE OR REPLACE PACKAGE BODY p_parameters_test AS
      PROCEDURE p_null_output_basetype(p1 OUT NUMBER,p2 OUT VARCHAR2)
      AS
      BEGIN
        DBMS_OUTPUT.PUT_LINE('DO NOTHING');
      END p_null_output_basetype;
    END;And I have below C# code:
    cmd.CommandText = "p_parameters_test.p_null_output_basetype";
    OracleParameter p1 = new OracleParameter("p1", OracleDbType.Decimal, System.Data.ParameterDirection.Output);
    OracleParameter p2 = new OracleParameter("p2", OracleDbType.Varchar2, System.Data.ParameterDirection.Output);
    cmd.Parameters.Add(p1);
    cmd.Parameters.Add(p2);
    try
        conn.Open();
        cmd.ExecuteNonQuery();
        if (p1.Value==null)
            Console.WriteLine("p1.Value==null");
        else if (Convert.IsDBNull(p1.Value))
            Console.WriteLine("Convert.IsDBNull(p1.Value)");
        else
            Console.WriteLine("p1 else "+p1.Value);
        if (p2.Value==null)
            Console.WriteLine("p2.Value==null");
        else if (Convert.IsDBNull(p2.Value))
            Console.WriteLine("Convert.IsDBNull(p2.Value)");
        else
            Console.WriteLine("p2 else "+p2.Value);
        Console.WriteLine("finished");
    catch......The output of it is:
    p1 else null
    p2 else null
    Does anyone have any idea why it always goes to the 'else' of the condition-branching, and how can I check if the output parameter is null?
    Thanks in advance.

    Morven... I ran into similar problems. Maybe you've found a solution of your own by now, but here's what I've learned...
    The Value property of output parameters, like p1 and p2 in your code, actually varies, according to (I think) the OracleDbType of the parameter. You've got OracleDbType.Decimal for p1 and OracleDbType.Varchar2 for p2. These look about right, since they match the parameter types in your actual stored procedure.
    After cmd.ExecuteNonQuery() executes, the respective Value properties of p1 and p2 are actually of different types. For p1, it's going to be "OracleDecimal" and for p2 it's "OracleString". Keep in miind that these are the types of the Value property of the OracleParameter objects, not the OracleParameter objects themselves.
    OracleDecimal and OracleString (and some other types like OracleDate, etc.) have an "IsNull" property you can use if you cast the Value property to its runtime type...
    if ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull) { …do something… }
    else { …do something else… }
    Or maybe something like this...
    Decimal p1val = ((OracleDecimal)cmd.Parameters["p1"].Value).IsNull ? 0 : ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value;
    I'll admit that expressions like this: ((OracleDecimal)cmd.Parameters["AVG_SALARY"].Value).Value look a little weird. But the "Value" of the "OracleDecimal" property is a regular .NET decimal type (System.Decimal). So, it's a "Value" of the "Value" property of the OracleParameter class.
    Even when the stored procedure returns a null, the Value property is still populated. In the case of p1, it's populated with an OracleDecimal object (actually a struct) where IsNull is true. That's why "p1.Value==null" tests false.
    From what I can see, OracleDecimal, OracleString, etc. will never be typed as DbNull, or DBNull.Value. So, that would be why Convert.IsDBNull(p1.Value)) always returns false. btw, it appears that these are Value types. That would suggest that coding something like like this, should be avoided…
    OracleString p2val = ((OracleString)cmd.Parameters["p2"].Value;
    if (p2val.IsNull) { …do something… }
    else { …do something else… }
    By assigning the value to another variable, you’d be actually creating an entire copy of the OracleString structure, which is pointless.
    I hope that helps
    Edited by: 897674 on Jan 3, 2012 10:44 AM
    Edited by: 897674 on Jan 3, 2012 10:46 AM

Maybe you are looking for

  • Can't get past the Terms of Use???

    I can't get to the end of the terms of use - can't get past 24.9 to continue with the download. I'm no whizz but I'm pretty sure it's not me. Help please

  • Why does my new PSE12 crash after about 1 minute?

    I used PSE8 for several years successfully, on a desktop running WinXP. Always reliable, if a little slow backing up etc with my huge (75K images) catalog. My brand new desktop now runs Win7, 64 bit. It is a high-spec machine. I bought PSE12 and conv

  • Officejet 4500 Wireless repeatedly asks me to realign cartridges in Win7

    My Officejet 4500 Wireless All-in-One functions quite well, so far, except for one detail: If I turn the printer on AFTER starting up Windows 7, the printer always asks me to align the cartridges, and most of the time, whenever I try, I get an alignm

  • Looks Like the Premiere Fora Just Got a Shakeup!

    Man, teach me to go to sleep. Went to the old Pr forum, and saw a bunch of CS4 posts there. Dutifully went about pointing them to the PrPro forum, ONLY to find out that the Pr Forum (Older versions prior to PrPro.... ) is not the "Pr/Pro prior to CS5

  • Not enough grunt in my emac to make a HD movie!

    Hi, I have a powermac 6.1. More info: Model Name: iMac Model Identifier: PowerMac6,1 Processor Name: PowerPC G4 (3.3) Processor Speed: 1 GHz Number Of CPUs: 1 L2 Cache (per CPU): 256 KB Memory: 1 GB Bus Speed: 133 MHz Boot ROM Version: 4.5.9f1 Serial