Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-165

Getting return value generatedKeys from stored procedures in inserts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • DataAccess 1.5
    • DataMapper 1.5
    • DataMapper
    • None
    • .net framework 2.0

    Description

      When calling a stored procedure that does a insert and returns the row idendity in a return statement, like

      CREATE PROCEDURE [dbo].[DoFoo] @foo int AS
      INSERT INTO Foos (foo) VALUES (@foo)
      RETURN @@IDENTITY

      there is no way of accessing the return value and returning it as the generatedKey

      Attachments

        1. MappedStatement.cs.patch
          1 kB
          Oddur Magnusson
        2. procedure.cs.patch
          2 kB
          Oddur Magnusson
        3. category-procedureWithReturn.sql
          0.3 kB
          Oddur Magnusson
        4. complete.patch
          8 kB
          Oddur Magnusson

        Activity

          People

            Unassigned Unassigned
            oddur Oddur Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: