You need to refresh the root_node to get the id.
How do you insert
1- As a batch, do you first insert root_node rows and then child_nodes
OR
2- Insert one root_node, insert child nodes of the root and then the next root_node.
If 1 then refreshing root will solve your problem and ADO Dataset will re-read the id after inserting
If 2 then I could recommend some DB procedure etc. to get the root_id and then insert this root_id to your root record. Refreshing will still solve the problem but it may be slow.
Which database are you using?
Main Topics
Browse All Topics





by: tirbanqsPosted on 2009-08-30 at 09:06:17ID: 25218110
//Further explanation
Master table: Root_Node
Fields: id, description
Detail table: Child_Node
Fields: id, root_id, description {root_id is from the table Root_Node}
... when creating a root node, i need to get the id because i will be needing it when creating a child node.
On a batch mode, after inserting a new record, the id is 0. This is where my problem is since i need the id for the child node table.