SQL: insert a row and return the primary key value

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
1 post Page 1 of 1

rickc

Posts: 5
Joined: Wed Sep 10, 2014 11:33 am

Post by rickc » Sat May 06, 2017 9:18 am
I have a MFT project that inserts data to a Postgresql table.
The table is defined with a primary key using an auto-increment column.
Example:
Code: Select all
CREATE TABLE tracker
(
  tracking_id serial,
  filename varchar(100),
)
The insert statement has a "returning" clause to return the value of the tracking_id field after the insert is complete:
Code: Select all
insert into public.tracker
(tracking_id,filename)
values (default,${tempchuScratch})
returning tracking_id;
I would like to use the trackind_id value us subsequent steps in the MFT project. How do I capture the tracking_id value?


Rick
1 post Page 1 of 1