Subject | Invalid reference to delete |
---|---|
Author | Rick Roen |
Post date | 2005-01-28T00:35:23Z |
Delphi 7
IBO 4.3
I'm trying to delete a record from the following IBO_Query and get
the message "Invalid reference to delete".
I can delete ok from the data view in the component itself, but not
from the program.
The PK for InvoiceItems table is IDNUM.
The SQL is:
SELECT II.IDNUM
, II.ORDERNUM
, II.INVOICENUM
, II.ITEMNAME
, II.ITEMNUM
, II.ETD_DATE
, II.QTY_ORDER
, II.QTY_SHIP
, II.UNITS
, II.COST
, (II.QTY_ORDER * II.COST) AS COST_ORDER
, (II.QTY_SHIP * II.COST) AS COST_INVOICE
, NULLIF(II.LOTNUM, 0) AS LOTNUM
, II.TREATMENT
, II.PACKING
, II.GERM
, II.DATEGERM
, II.NOTE
, II.COMPLETE
FROM INVOICEITEMS II
JOIN ITEMS I ON I.ITEMNUM = II.ITEMNUM
ORDER BY I.NON_SEED_ITEM, II.ITEMNAME
And the Delete is:
DELETE FROM INVOICEITEMS
WHERE
IDNUM = :OLD_IDNUM
Any suggestions?
Rick
IBO 4.3
I'm trying to delete a record from the following IBO_Query and get
the message "Invalid reference to delete".
I can delete ok from the data view in the component itself, but not
from the program.
The PK for InvoiceItems table is IDNUM.
The SQL is:
SELECT II.IDNUM
, II.ORDERNUM
, II.INVOICENUM
, II.ITEMNAME
, II.ITEMNUM
, II.ETD_DATE
, II.QTY_ORDER
, II.QTY_SHIP
, II.UNITS
, II.COST
, (II.QTY_ORDER * II.COST) AS COST_ORDER
, (II.QTY_SHIP * II.COST) AS COST_INVOICE
, NULLIF(II.LOTNUM, 0) AS LOTNUM
, II.TREATMENT
, II.PACKING
, II.GERM
, II.DATEGERM
, II.NOTE
, II.COMPLETE
FROM INVOICEITEMS II
JOIN ITEMS I ON I.ITEMNUM = II.ITEMNUM
ORDER BY I.NON_SEED_ITEM, II.ITEMNAME
And the Delete is:
DELETE FROM INVOICEITEMS
WHERE
IDNUM = :OLD_IDNUM
Any suggestions?
Rick