Interacting with Oracle Stored Procedures. RRS feed

  • Question

  • I'm having a bit of a problem that I hope someone can help me with. I have PL/SQL stored procedure in Oracle 10 XE. Its a simple little guy, basically it checks to see if something exists already and if the row already exists it will return the existing row in a REF CURSOR. If it doesnt exist, it does an insert and returns what it inserted (what was passed in). The SP works fine when debugging it stand along. But when I try and call it via my C# code, Oracle gives me a PK constraint exception, it appears to be trying to insert the data twice, but there is nothing in the SP that does that, if it did, debugging the SP would reproduce that behavior. It appears the problem is cause by my trying to fill the ref cursor.

    I've tried calling the SP using adapters and calling Fill to populate the data. I've tried use ExecuteNonQuery and get the same results. Am I trying to do something that isn't possible. I've even commented out everything in the SP except a single Insert and it still gives me FK constraint exceptions.

    Thanks in advance!
    • Moved by Chris Robinson- MSFT Monday, March 2, 2009 4:55 PM Oracle Stored Procedure question (Moved from ADO.NET DataSet to ADO.NET Data Providers)
    Monday, March 2, 2009 1:41 PM

All replies