Troubleshooting - Getting Error [QODBC] Requires at least one child. I cannot delete the last line
I entered a series of purchase orders with queries that look like this:
INSERT INTO PurchaseOrderLine ("VendorRefListID", "RefNumber","PurchaseOrderLineItemRefListID", "PurchaseOrderLineDesc", "PurchaseOrderLineQuantity", "PurchaseOrderLineRate", "PurchaseOrderLineAmount", "FQSaveToCache") VALUES ('8000002F-1480957977', '1485', '800002C0-1480957977', '50-pc briquette set for hp 94751', 500, 8.00, 4000.00, 0);
I ran queries for c. 400 line items for 48 po's.
This resulted in two distinct po's for each PO number, twice as many line items as I had intended.
I first thought to start over and try again. To that end, I ran this:
Delete FROM PurchaseOrderLine where TxnID='2770-1071519624'
ERROR: [QODBC] Requires at least one child. I cannot delete the last line. This results in this error: This results in this error: This results in this error:
So, I'm out of ideas.
Please tell me how to get rid of the duplicates.
You have only one line item in a PurchaseOrderLine table for that particular TxnId. You cannot use the last line item, which is associated with the header row of PurchaseOrder. You cannot delete the previous line.
You need to delete the header row from the PurchaseOrder table, So please try to delete the row for that particular TxnID from the PurchaseOrder table. Please verify the same & try again.
Please refer to the sample query & check again.
Delete FROM PurchaseOrder where TxnID='2770-1071519624'