Author |
Message
|
dianmushkov |
Posted: Wed May 22, 2013 9:57 pm Post subject: Mapping Node with SQL Server identity primary key |
|
|
Newbie
Joined: 09 May 2013 Posts: 9
|
What is the concept with identity primary key and mapping node.
How could I get value of inserted identity.
I guess I can make select statement after mapping node but I believe more elegant solution exists. |
|
Back to top |
|
 |
kash3338 |
Posted: Thu May 23, 2013 5:28 am Post subject: Re: Mapping Node with SQL Server identity primary key |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
dianmushkov wrote: |
What is the concept with identity primary key and mapping node.
How could I get value of inserted identity. |
Make use of a Stored Procedure to do your DB insert and with the help of SCOPE_IDENTITY() you will be able to get the ID of the last record inserted by the same code context in which it executes.
Invoke the Stored Procedure and get the value returned to your flow. To invoke a Stored Procedure using mapping node, refer here |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 23, 2013 6:49 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Nothing wrong with the stored procedure solution...but the Mapping node cannot call a stored procedure. You would need to call out to ESQL for that. |
|
Back to top |
|
 |
kash3338 |
Posted: Thu May 23, 2013 6:59 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Oh I missed out on the product type mentioned by the OP. SQL Server Stored Proc cannot be invoked using a mapping node, but the below statement needs to be tuned a bit,
kimbert wrote: |
but the Mapping node cannot call a stored procedure. |
but the Mapping node cannot call a stored procedure, other than DB2 and Oracle. Here is the link to it (same as above). |
|
Back to top |
|
 |
dianmushkov |
Posted: Sun May 26, 2013 11:47 pm Post subject: |
|
|
Newbie
Joined: 09 May 2013 Posts: 9
|
|
Back to top |
|
 |
|