on 09-30-2014 7:42 AM
Dear Experts,
I have a scenario: SQL--> IDoc.
In the SQL DB there are 3 tables:
- OrderHeader
Index (Primary-Key), OrderID, Date, CustomerID....
- OrderPostion
Index, PosID, OrderID, (Primary-Keys), ItemID, Quantity, Unit...
- StatusProtocol
Index (Primary-Key), Status, Type, SenderSys, ReceiverSys...
I'm not familiar with SQL-Query, how to select Orders from these 3 tables, it could be looked as below:
select OrderID, CustomerID, Date from OrderHeader and select PosID, ItemID, Quantity .. from OrderPostion where Index = Index and Index in (Select Index from StatusProtocol where Status=Ready, Type = Order, SenderSys = ExternApp...)
After selection the Status of the table StatusProtocol must be updated to Finished.
Could anyone give me a hand?
Hope you can understand me.
Thank u very much and Regards
Christine
Can you try with below?
select OrderHeader.OrderID,OrderHeader.CustomerID,OrderHeader.Date,OrderPostion.PosID,OrderPostion.ItemID,OrderPostion.Quantity from OrderHeader JOIN OrderPostion on
OrderHeader.Index = OrderPostion.Index and OrderPostion.Index in
(Select StatusProtocol.Index from StatusProtocol where SStatusProtocol.status='Ready', StatusProtocol.Type = 'Order', StatusProtocol.SenderSys = 'ExternApp')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.