How to retrieve the last inserted row
This may be a question with a very known answer but I couldn't find any within this forum.
What is the proper way to retrieve the just inserted record ?
I'm accessing the DB from external Java and at this moment I use a timestamp column in order to retrieve the inserted row. So I generate an unique timestamp ('20020615184524356') which I inserted during the insert operation. I retrieve the just inserted row using "select * from fooTable where(timestamp='20020615184524356')".
Is this the general idea or am I totally wrong ?