I'm looking for a way to store the last auto id that was inserted into a mysql database.
Basically, I need to insert a new observation into a database using SAS. The obervation will get an auto id once inserted. I required this auto id for inserting another observation into a different table.
I'm just wondering, I'm guessing I can only use
select LAST_INSERT_ID() as id
when using pass-thru sql, how am I to get this value out into the local sas when my data to be inserted is stored locally. I've got a local table in work, that I need to insert into a remote table, but I will required the auto id from one insert instance to be used for the next insert instance.
Or is it possible to use pass-thru sql to read from a local table and insert data into remote table?