Knowledgebase: QODBC
[QODBC-Desktop] Troubleshooting - Getting Error [QODBC] Requires at least one child. Cannot delete last line
Posted by Jack - QODBC Support on 13 December 2016 06:40 AM

Troubleshooting - Getting Error [QODBC] Requires at least one child. Cannot delete last line

Problem Description:

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.

For whatever reason, this resulted in two distinct po's for each po number; that is, 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'

This results in this error:

ERROR: [QODBC] Requires at least one child. Cannot delete last line.

 

So, I'm out of ideas.

Please tell me how to get rid of the duplicates. 

Solution:

You cannot delete the last line. I think you have only one line item in a PurchaseOrderLine table for that particular TxnId. You cannot last line item which is associated with header row of PurchaseOrder.

You need to delete the header row from PurchaseOrder table, So please try to delete the row for that particular TxnID from PurchaseOrder table. Please verify the same & try again.

Please refer below sample query & check again.

For Example:

Delete FROM PurchaseOrder where TxnID='2770-1071519624'

 

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).