[AccessD] Getting the Primary Key of a New records in Oracle

Stuart McLachlan stuart at lexacorp.com.pg
Tue Nov 5 15:50:34 CST 2013


A quick google found:
http://stackoverflow.com/questions/1145294/oracle-return-newly-inserted-key-value

INSERT INTO my_table (col_1, col_2)
  VALUES ('foo', 'bar')
  RETURNING pk_id INTO my_variable;

On 5 Nov 2013 at 16:13, Heenan, Lambert wrote:

> Does anyone know how I can retrieve the primary key value from a new
> record just added to a linked Oracle table using VBA?
> 
> I.e. I create a records using VBA, populate the fields with VBA and
> update the record. How do I then find out what the primary key value
> allocated by Oracle is? The key field is of type NUMBER(10) and it is
> populated by a trigger (which I have no control over).
> 
> Lambert
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list