Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 18 Mar 2004 @ 23:56:54 GMT


     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 


Subj:   Return Identity on INSERT
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, March 18, 2004 18:07 -->

Hi,

I want to create a stored procedure to insert a row to the database and then return the primaryKey value from the INSERT.

I did this:

CREATE PROCEDURE spInsertPerson
(IN name VARCHAR(20), IN dob VARCHAR(10), IN gender CHAR(1), OUT
returnKey INTEGER)
BEGIN
 INSERT INTO Person
 (name, dob, gender)
 VALUES  (:name, :dob, :gender);
 SET returnKey = ??????????????????
END;

How do I get the return key after the insert??

Many thanks



     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016