I have a sesquence associated to a table MYTABLE.
I need to create a file which name contains the unique sequence nextvalue (ex : "myfile-20161111-15) where 15 is the sequence value which will reference the file in MYTABLE.
Then I need to create a ROW in that table to save my file location :
ID | FILENAME (ID is the primary key)
15 | myfile-20161111-15
Is it safe and a good way to get the NEXTVALUE (without executing the INSERT immediatly) and then later, to INSERT the ROW using the unique value reserved ?
I execute the INSERT only after having created the file, and use the sequence value to store the unique ID