Last post Nov 04, 2012 08:54 PM by Decker Dong - MSFT
None
0 Points
6 Posts
Nov 04, 2012 01:35 AM|sasalyn|LINK
I faced problems in transferring data from two tables into another two tables at the same time..
I used LEFT OUTER JOIN to join both tables but there's still have errors..
string UpdateOrder = "INSERT INTO Order LEFT OUTER JOIN OrderDetails ON Order.orderNo = OrderDetails.orderNo (Order.orderDate,Order.totalOrderPrice,Order.membershipNo, OrderDetails.productNo, OrderDetails.productQty, OrderDetails.subTotalOrderPrice, OrderDetails.productColor,OrderDetails.productRemarks)" + "SELECT ShoppingCart.cartDate,ShoppingCart.totalCartPrice,ShoppingCart.membershipNo, CartDetails.productNo, CartDetails.productQty, CartDetails.subTotalOrderPrice, CartDetails.productColor,CartDetails.productRemarks" + "FROM ShoppingCart LEFT OUTER JOIN CartDetails ON ShoppingCart.cartNo = CartDetails.cartNo";
any one can help on this ???
All-Star
52793 Points
15764 Posts
Nov 04, 2012 06:20 AM|oned_gk|LINK
Nov 04, 2012 12:14 PM|sasalyn|LINK
I want to retrieve data from two tables into another two tables.
25756 Points
7014 Posts
Nov 04, 2012 05:12 PM|hans_v|LINK
sasalyn I faced problems in transferring data from two tables into another two tables at the same time..
Because you cannot insert data into 2 tables in 1 INSERT statement at the same time. You need to execute 2 INSERT statements
94130 Points
18109 Posts
Nov 04, 2012 08:54 PM|Decker Dong - MSFT|LINK
sasalyn I used LEFT OUTER JOIN to join both tables but there's still have errors..
What problem have you got?
Can you elebrate it more?
Exception?
None
0 Points
6 Posts
Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 01:35 AM|sasalyn|LINK
I faced problems in transferring data from two tables into another two tables at the same time..
I used LEFT OUTER JOIN to join both tables but there's still have errors..
string UpdateOrder = "INSERT INTO Order LEFT OUTER JOIN OrderDetails ON Order.orderNo = OrderDetails.orderNo (Order.orderDate,Order.totalOrderPrice,Order.membershipNo, OrderDetails.productNo, OrderDetails.productQty, OrderDetails.subTotalOrderPrice, OrderDetails.productColor,OrderDetails.productRemarks)" +
"SELECT ShoppingCart.cartDate,ShoppingCart.totalCartPrice,ShoppingCart.membershipNo, CartDetails.productNo, CartDetails.productQty, CartDetails.subTotalOrderPrice, CartDetails.productColor,CartDetails.productRemarks" +
"FROM ShoppingCart LEFT OUTER JOIN CartDetails ON ShoppingCart.cartNo = CartDetails.cartNo";
any one can help on this ???
All-Star
52793 Points
15764 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 06:20 AM|oned_gk|LINK
Suwandi - Non Graduate Programmer
None
0 Points
6 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 12:14 PM|sasalyn|LINK
I want to retrieve data from two tables into another two tables.
All-Star
25756 Points
7014 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 05:12 PM|hans_v|LINK
Because you cannot insert data into 2 tables in 1 INSERT statement at the same time. You need to execute 2 INSERT statements
All-Star
94130 Points
18109 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 08:54 PM|Decker Dong - MSFT|LINK
What problem have you got?
Can you elebrate it more?
Exception?