Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to insert a single order row and multiple order detail rows into order details table?  RSS feed

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue is accuracy. Could you show me the SQL of this query?
Order
OrderID CustomerID EmployeeID PurchaseDate PurchaseTime PurchaseDate Reason

Order Details
OrderDetailID OrderID ProductID GrossSales Quantity Discount NetSales WarrantyExpirationDate
Thanks
Jack
 
author & internet detective
Marshal
Posts: 37714
579
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about you write the SQL and we provide comments on it? We like to help people learn here and giving you the whole code doesn't feel like that.

As a hint, take a look at updateBatch() so all the SQL goes in under the same transaction.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!