Returning Clause out parameter not working

I have Oracle 11g (I think?) and VS2010.
I am using an insert statement with the returning clause to return an identity value that is created by a Sequence/Trigger. The problem I am having is that it is not updating the out parameter in C#. Here's some sample code. I have tested the insert statement in SQL Developer and it works. The C# statement does do the insert, but the out parameter remains null. I have tried ParameterDirection as ReturnValue, InputOutput, and Output. None of those worked. The output value remains null no matter what I try to do. I even lifted this example (Oracle Sequences), ran it, and it also errored and is not returning out parameters. (Error Msg: Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' to type 'System.IConvertible'.Couldn't store <null> in ID Column.  Expected type is Int32.).
I have searched and searched the web over and I cannot figure out why this does not work. Any help would be most appreciated!!
MyTable
MyTable_ID  Number (38)
Note            Varchar2 (500 byte)
=================================================
                try
                    if (insertCmd.Connection.State == ConnectionState.Closed)
                        insertCmd.Connection.Open();
                    int recs = insertCmd.ExecuteNonQuery();
                    this.Id = Convert.ToInt32(insertCmd.Parameters[":Id"].Value);
                catch (Exception err) {  }
                finally {  insertCmd.Connection.Close(); }
private OracleCommand insertCmd
            get
                OracleCommand insCmd = Context.DataBaseConnection.CreateCommand();
                insCmd.CommandText = string.Format(
                    @"Insert into MyTable (Note)
                      Values (:Note)
                      Returning MyTable_ID into :Id");
                insCmd.Parameters.Clear();
                OracleParameter noteParam = new OracleParameter(":Note", OracleDbType.Varchar2, Note, ParameterDirection.Input);
                OracleParameter idParam = new OracleParameter(":Id", OracleDbType.Int32, 38, "Calibration_Session_Id");
                idParam.Direction = ParameterDirection.Output;
                insCmd.Parameters.Add(idParam);
                insCmd.Parameters.Add(noteParam);
                insCmd.BindByName = true;
                return insCmd;

Okay, I changed my insert command text to this...
insCmd.CommandText = string.Format(
                    @"Begin
                         Insert into MyTable (Note)
                         Values (:Note)
                         Returning MyTable_ID into :Id;
                         Commit; End;");
There was no change. Am I doing an explicit transaction wrong?

Similar Messages

  • Macbook Pro 2011 DVI HDMI out does not work with TV when the power cable is connected

    My Macbook Pro (Early 2011) DVI HDMI out does not work with TV when the power cable is connected. If get the blue screen and then can use the macbook but nothing is displayed on the TV. If i go into display I can see that there are two screens but nothing displayed on the TV. If i take the power cable out at this point the TV shows the second desktop as expected. If i then reconnect the cable, the screen flickers, as though it is being affected by the power cable, and the screen goes blank on the TV. Only if i remove the DVI cable do i get the blue screen again. If i remove the power cable and reconnect it will do it every single time, so i cannot see it being a TV issue or a minor glitch.
    I have had this working previously but at the minute it seems to not be playing ball....any thoughts
    Thanks
    Dan

    BUMP
    Any ideas?

  • Satellite 1800-100: video-out does not work

    He,
    I just installed windows XP on my old Satellite 1800-100, but now my video-out does not work anymore. So I just downloaded the latest driver, but there's no way I can get it installed. According to Windows the new driver isn't newer, so it won't let me update it. And when i try to unistall the display driver, I have to reboot before it takes effect, and wile rebooting it automaticly installs the standard driver again.
    Can anybody help me?
    Greets,
    Daan

    Hi
    Do you mean TV- out port or monitor port? As far as I know this unit is preinstalled with WXP Home and all drivers can be also used for WXP Pro.
    Did you preinstall your own OS (non recovery image)?

  • DVI video out suddenly not working.

    That's basically it. I have a 23-inch Cinema HD Display at home and at the the office. Suddenly the video out is not working with either of them. The displays control panel lists the external display, so the system is detecting the connected display.
    There is nothing wrong with the displays. I connected an old PowerBook and they light up fine. With my MBP, the power light lights, but nothing is displayed on the Screen.

    there's a somewhat similar thread "external monitor stopped working" with no answers
    my 17" Studio display works as 2nd mon on other computers
    my dvi out does work with a vga monitor and adapter, of course :))
    i'm using the dvi to adc adapter -- could this be involved somehow?
    my laptop display goes blue when i plug in the external monitor as it should, but the 2nd monitor never wakes up, turns on, etc.

  • Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

    Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

    Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

  • System.out.println not working in Tomcat-4.1.x

    System.out.println not working in Tomcat-4.1.24. Any settings has to be enabled??? I am using tomcat for Solaris

    I think u can use ServletContext.log() to output info instased.

  • I have Iphone4 and my Iphone wifi button greyed out mean not working, Please suggest what need to do.

    I have Iphone4 and my Iphone wifi button grayed out mean not working, Please suggest what need to do and i am using ios 6.

    Please ask your question

  • I have a problem with the keyboard on my MacBook. The letters are typing as symbols and the delete and return/enter buttons do not work. Does anybody know how to fix this?

    I have a problem with the keyboard on my MacBook. The letters are typing as symbols and the delete and return/enter buttons do not work. Does anybody know how to fix this?

    Hey skyshade13,
    Thanks for the question. The following article outlines how to restore a previous iTunes library should there be no content after updating. While the article does not speak specifically to your symptoms, attempting the steps by utilizing the "Previous iTunes Libraries" folder may resolve your issue.
    No content shows up in iTunes after updating
    http://support.apple.com/kb/TS1967
    For further information see the following information:
    OS X Lion: iTunes opens to "created by a newer version" alert
    http://support.apple.com/kb/TS3918
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/HT1451
    Thanks,
    Matt M.

  • Upgraded to iOS5.1 and now video out is not working. How do I fix this?

    After upgrade to iOS 5.1 the video out is not working! Anyone have this problem? Is there a fix for this? 

    OK so I went to the Apple Store and they said my cable was a third party cable. We tried an apple cable and it worked! So Apple changed the pin out configuration on the OS 5.1 upgrade so only Apple cables will work! So I had to shell out another $40.00 to get that cable!

  • Zoom in and out is not working in folders after installing Lion OS

    Zoom in and out is not working in folders after installing Lion OS. Did not understand why?

    Feature has been removed AFAIK. As far as zoom is concerned, the new operating system has been..whatever the opposite of optimized is...pessimized?

  • REST Web Service Output Parameter not working in POST Handler

    I've created a RESTful Web Service in Oracle Apex, using a POST method as "handler".   I've setup 11 input parameters which all work fine, it is my one output parameter that does not return successfully.
    Here is detail on the Output Paramter
    Name:  returns
    Bind Variable Name:  :returns
    Access Method:  OUT
    Source Type: Response
    Parameter Type:  String
    The actual source is a call to a pl/sql package that returns a value that I set :returns equal to (eg :returns := v_result).   I've tried this with Source Type Header and still the same result, 'no output'.
    I see APEX is calling wwv_flow_api.create_restful_param to generate the parameters (for importing), is there any documentation on this procedure?
    How can I get this output parameter to return something in the response?
    The request accepts a Json payload.
    Any help greatly appreciated
    Thanks,
    James

    Solved my own problem :returns does not work needs to be returns
    Does Not Work
    Name:  returns
    Bind Variable Name:  :returns
    Access Method:  OUT
    Source Type: Response
    Parameter Type:  String
    Does Work
    Name:  returns
    Bind Variable Name:  returns
    Access Method:  OUT
    Source Type: Response
    Parameter Type:  String

  • Outer join not working

    Hello everybody,
    I have a folder based on materialized view (Detailed folder). There is another folder which is based on a table (master folder). i have created a jooin and select option as "outer join on master folder". The join is not working properly. Am i doing asomething wrong. Discoverer version is 10.1.2 and database version is 10.2.0.3. i have been creating outer joins among folders based on tables but i am not sure about whats wrong this time??? materalized view defination is as follows:
    CREATE MATERIALIZED VIEW MW
    BUILD IMMEDIATE
    REFRESH FORCE
    START WITH SYSDATE
    NEXT TRUNC(SYSDATE+1)+1/4
    WITH PRIMARY KEY
    AS
    SELECT * FROM VIEW
    Thanx for your help
    Regards,
    Najeeb

    So, let me see if I got this...
    You have a table and a materialized view. There is a join between the two, where the table is the master, and the MV is the detail. The join is set to be an outer join on master. Ultimately, you want to see the values in the MV where the join condition is NULL.
    What boggles me is that you say the query runs fine in the database, but not in Disco. This could mean that there is a condition in the BA or in the worksheet. But, if that were the case, the condition should show up in the SQL generated by Disco.
    It looks like the where clause is the problem. NULL is never equal to anything, so when APPROVEDBY is null, the where clause should fail and no data returned. This explains Disco's behavior, but not SQL's.
    Something to try: Create a calculation in the materialized view folder of the business area like:
    NVL(APPROVEDBY, -1)
    I am assuming that all of your IDs are positive. Then modify the join to use the calculated column. This should convert the NULLS to values, and the report should work.

  • SET/GET Parameter not working? pls hlp

    hi i am using a transaction variant on transaction LT01 - create transfer order. using the transaction variant i have greyed out 3 fields on the initial screen. for the greyed out fields i am passing the values using a SET PARAMETER. This is working fine for 2 fields but it does not work for the third field. any idea where i am going wrong?? the first field is warehouse number which is working fine. the second field is movement type and the third field is storage location. the first 2 works fine and the data gets populated in the greyed out field but the storage location field does not work. The field has a parameter id. pls help its urgent.
    promise will reward points if its resolved

    Hi american,
    1. but the storage location field does not work.
    In such cases, we have to follow another approach.
    (CALL TRANSACTION USING BDCDATA
    2. Just copy paste in new program.
      (it will populate the STORAGE LOCATION field)
    3.
    report abc.
    data : bd like table of bdcdata with header line.
    bd-program  = 'SAPML03T'.
    bd-dynPRO = '0101'.
    bd-dynbegin = 'X'.
    append bd.
    CLEAR BD.
    bd-fnam = 'LTAK-BWLVS'.
    bd-fval = 'AAA'.
    append bd.
    bd-fnam = 'LTAK-LGNUM'.
    bd-fval = '015'.
    append bd.
    STORAGE LOCATION
    bd-fnam = 'LTAP-WERKS'.
    bd-fval = 'AAA'.
    append bd.
    CALL TRANSACTION 'LT01'
    USING BD.
    regards,
    amit m.

  • Out.flush() not working

    I can't get the out.flush to work. The page is paused until all values are finished then it is displayed. Here is my example code.
    <pre>
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class MyTest extends HttpServlet {
         public void init(ServletConfig conf) throws ServletException {
    super.init(conf);
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws IOException {
    // res.setContentType("text/html"); //this nor the one below works
    res.setContentType("multipart/x-mixed-replace;boundary=\"boundary\"");
    PrintWriter out = res.getWriter();
    for(int x=0;x<3;x++){            
         out.println("<br>x = "+x);
         out.flush();
              try{
                        Thread.sleep(1000); //in milliseconds - 1000 milliseconds = 1 second
                   catch(InterruptedException ie){}
    </pre>

    You were hoping that the output of the servlet would be sent piece by piece to the client browser as you generated it? That is not how it works. Nothing is sent until you return from the service method. It is possible to do what I think you were hoping, but you have to work with the browser and have it refresh periodically. I have seen examples of that but I am not competent to try to explain it.

  • Left Outer Join Not working in BI 7.0 Infoset

    Hi All,
    I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
    I have a DSO where for a “subteam” value target has been set up on different KPIs.
    In the Info Cube, I have transactional data on daily basis per “subteam”. I have to show the actual and target values.
    I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the “subteam” values (From DSO, irrespective of whether the data is available in cube for those sub team).
    I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
    Any Idea why the Outer Left Join is not working? The DSO has only one fey field called “subteam” on which I have set outer left join.
    Regards,
    Amit

    Hi,
    did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
    Let me know if you have found a solution, it would be appreciated.
    have a nice day,
    Dominic

Maybe you are looking for

  • How to set polling interval for database adapter in interconnect?help plz!!

    Hi i have 4 database adapters with same name subscribing to same event in 4 different interconnect instances(i.e., same business event and application event in different hubs) and pointing to same source application database , same destination applic

  • Decrypt the hashed password in SQL Server 2008

    Hello all, I have used HASHBYTES to decrypt the password of the user using SHA1, so now there is a requirement to decypt back the password  to its original form,  for eg Pass word is 'Jhon' so after applying HASHBYTES('SHA1','Jhon') it gices the outp

  • How do I stop Excel from trying to rebuild the Outlook database when I try to open a .xls file?

    Using Office 2011. When I try to open a .xls or .docx file, Excel or Word wants to rebuild the Outlook database. I do not have Outlook installed. The file will open if I dismiss the Outlook query popup, and double click on the same file I just tried

  • Short-cut key to rotate current page

    In Acrobat Pro 9, Is there a single key stroke to rotate current page clockwise/counter clockwise 90°? Not Shift+Ctrl-R, because you have to select some parametes. It is not a single key stroke. If not, then how to do that by some ways, e.g., macro,

  • Got the new 6301 -- so far, not happy!

    Why is my phone so slow? Clicking on the menu takes ages to load (compared to 6300, which my friend has). Things are complicated in this phone and it seems I can't make them simple. Example: I don't see any "Inbox" in shortcuts, instead of clicking 3