This topic is locked
[SOLVED]

PHPRunner Import screen - Update statement as record with P Key already exists

5/8/2025 2:24:36 AM
PHPRunner General questions
R
Rupesh author

INSERT INTO sale_invoices(sale_date, doc_type, invoice_no, customer_name, sale_qty, sale_rev_amount, sale_amount) VALUES ('2025-03-12', 'Sale', '3241371', 'Wadehra & Co. P.Ltd.', 1, null, 17416.00)
SELECT sale_date, doc_type, invoice_no, customer_name, sale_rev_amount, sale_amount, sale_qty FROM sale_invoices WHERE ( ( ( ( invoice_no='3241371' ) ) ) ) ORDER BY sale_date DESC limit 0, 1
UPDATE sale_invoices SET sale_date='2025-03-12', doc_type='Sale', customer_name='Wadehra & Co. P.Ltd.', sale_qty=1, sale_rev_amount=null, sale_amount=17416.00 WHERE ( 1=0 ) and ( ( invoice_no='3241371' ) )
INSERT INTO sale_invoices(sale_date, doc_type, invoice_no, customer_name, sale_qty, sale_rev_amount, sale_amount) VALUES ('2025-03-12', 'Sale', '3241372', 'Armech Engineers Pvt.Ltd', 1, null, 2700.00)
SELECT sale_date, doc_type, invoice_no, customer_name, sale_rev_amount, sale_amount, sale_qty FROM sale_invoices WHERE ( ( ( ( invoice_no='3241372' ) ) ) ) ORDER BY sale_date DESC limit 0, 1
UPDATE sale_invoices SET sale_date='2025-03-12', doc_type='Sale', customer_name='Armech Engineers Pvt.Ltd', sale_qty=1, sale_rev_amount=null, sale_amount=2700.00 WHERE ( 1=0 ) and ( ( invoice_no='3241372' ) )
INSERT INTO sale_invoices(sale_date, doc_type, invoice_no, customer_name, sale_qty, sale_rev_amount, sale_amount) VALUES ('2025-03-12', 'Sale', '3241373', 'Shriram Pistons & Rings Ltd. - GZB/BR', 2, null, 57400.00)
SELECT sale_date, doc_type, invoice_no, customer_name, sale_rev_amount, sale_amount, sale_qty FROM sale_invoices WHERE ( ( ( ( invoice_no='3241373' ) ) ) ) ORDER BY sale_date DESC limit 0, 1
UPDATE sale_invoices SET sale_date='2025-03-12', doc_type='Sale', customer_name='Shriram Pistons & Rings Ltd. - GZB/BR', sale_qty=2, sale_rev_amount=null, sale_amount=57400.00 WHERE ( 1=0 ) and ( ( invoice_no='3241373' ) )

R
Rupesh author 5/8/2025

Apologies for the missing portion in main query,.

WHERE ( 1=0 )
in the update statement is not allowing to update the records.