Unanswered: Returning the "Auto-Increment" column value
I have table where one of the column is "Auto-Incremented". Whenever I insert data into that table the query should retuun the value of the Auto-Incremented column. So that I can use that value in my further queries. Please help to achieve this functionality.
But my requirement is I should not call the any function or query again. Along with the insert query inself the value should return.
My actual requirement is :
I have two tables (parent and child) when ever I call insert method, first I will insert data into the parent table and then I should insert data into the child table where I required the "Auto-Increment" column value to be inserted in the child table.
If I use function to get the latest id I will have problem when multiple users uses my application.
I don't know anything about your application but I think a function wouldn't be a bad idea for inserting the parent. The function would insert the parent and then return the id of the parent. Each process would use this value when adding it's children. Also if there is little difference between a parent and a child I'd say use the same table and hence the same function to add these as well.