Post Table error 'Refresh failed. Found 0 records'

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kneighbour
Posts: 70
Joined: Wed 08 Oct 2008 04:55

Post Table error 'Refresh failed. Found 0 records'

Post by kneighbour » Thu 08 Aug 2019 02:39

Using UniDac 8.0.1 and Delphi XE7 and Firebird 3. I have recently upgraded to the latest UniDac and this problem seems to only have turned up now. I am not sure of this, but this problem was not in my code some time back.

I am using UniTable, doing a simple INSERT and then a POST.

I can 'fix' the problem by setting StrictUpdates=false as you suggest in a previous forum post, but this does not seem like the correct thing to do.

This only happens in a couple of places. I have thought that I might have been updating this table in external code, but no - it is a simple INSERT, set the field values, then a POST. This table does not have a primary field normally, but I added one and it makes no difference.

I turned on DBMonitor as suggested and this seems to be the query just before I do the POST. Bit weird looking. If I display the actual table.sql property it is 'SELECT * FROM INVHTBL' as you would expect.

Code: Select all

Processing transaction - Savepoint LOCK_INVHTBL  [$0C4E2D50] 
Processing transaction - Savepoint LOCK_INVHTBL  [$0C4E2D50] 
Execution - SELECT NULL FROM INVHTBL
WHERE
INVH_SYSC_NUMBER = ? AND INVH_ORDER_NO = ? AND INVH_STATUS = ? AND INVH_ENTRY_TYPE = ? AND INVH_ORD_DATE = ? AND INVH_SUPPLIER_NO = ? AND INVH_SUPPLIER_NAME = ? AND INVH_AREA_NUMBER = ? AND INVH_GST_INV_YN = ? AND INVH_DEL_NO IS NULL AND INVH_DEL_DATE IS NULL AND INVH_INV_NO IS NULL AND INVH_INV_DATE IS NULL AND INVH_INV_TOTAL IS NULL AND INVH_LINE_TOTAL IS NULL AND INVH_DISCOUNT_AMT IS NULL AND INVH_TAX_AMT IS NULL AND INVH_FREIGHT_AMT IS NULL AND INVH_GST_AMT IS NULL AND INVH_SUBSIDY_AMT IS NULL AND INVH_ADMIN_AMT IS NULL AND INVH_FINANCE_FEE_AMT IS NULL AND INVH_LAST_UPD_DATE IS NULL AND INVH_DEL_UPD_DATE IS NULL AND INVH_ORD_UPD_DATE IS NULL AND INVH_PAYMENT_DUE_DATE IS NULL AND INVH_ENTER_EXT_COST_YN = ? AND INVH_AP_POSTED_YN = ? AND INVH_GL_POSTED_YN = ? AND INVH_GST_EXEMPT_VENDOR_YN = ? AND INVH_FLAG_1_YN = ? AND INVH_LINE_GST_YN = ? AND INVH_LINE_DISC_YN = ? AND INVH_LINE_SUBSIDY_YN = ? AND INVH_TYPE_1_LITRES IS NULL AND INVH_TYPE_1_AMT IS NULL AND INVH_TYPE_2_LITRES IS NULL AND INVH_TYPE_2_AMT IS NULL AND INVH_TYPE_3_LITRES IS NULL AND INVH_TYPE_3_AMT IS NULL AND INVH_TYPE_4_LITRES IS NULL AND INVH_TYPE_4_AMT IS NULL AND INVH_TYPE_5_LITRES IS NULL AND INVH_TYPE_5_AMT IS NULL AND INVH_TYPE_6_LITRES IS NULL AND INVH_TYPE_6_AMT IS NULL AND INVH_TYPE_7_LITRES IS NULL AND INVH_TYPE_7_AMT IS NULL AND INVH_TYPE_8_LITRES IS NULL AND INVH_TYPE_8_AMT IS NULL AND INVH_TYPE_9_LITRES IS NULL AND INVH_TYPE_9_AMT IS NULL AND INVH_CALC_TOTAL IS NULL AND INVH_REF_CODE IS NULL AND INVH_ORDER_TYPE_CODE IS NULL AND INVH_SENT_DATE IS NULL AND INVH_RECEIVED_DATE IS NULL AND INVH_LOCATIONID = ? AND INVH_FREIGHTESTIMATE IS NULL AND INH_STATUS_DATE = ? AND INVH_MONEYONLY = ? AND INVH_PAYMENT_DATE IS NULL AND INVH_PAYMENT_REFERENCE IS NULL AND INVH_PURCH_REBATE IS NULL AND INVH_PURCH_FREIGHTREBATE IS NULL AND INVH_FULL_CTNQTY IS NULL AND INVH_FULL_LITRES IS NULL AND INVH_SUPPLIER_ORDER_NO IS NULL AND INVH_USERID = ?
FOR UPDATE WITH LOCK

:Old_INVH_SYSC_NUMBER(String[1],IN)='3' 
:Old_INVH_ORDER_NO(Float,IN)=18146 
:Old_INVH_STATUS(String[3],IN)='New' 
:Old_INVH_ENTRY_TYPE(String[7],IN)='Invoice' 
:Old_INVH_ORD_DATE(DateTime,IN)=08-Aug-19 
:Old_INVH_SUPPLIER_NO(String[7],IN)='GLADSTO' 
:Old_INVH_SUPPLIER_NAME(String[26],IN)='NAME OF SOME MOTEL HOTEL' 
:Old_INVH_AREA_NUMBER(Float,IN)=0 
:Old_INVH_GST_INV_YN(String[1],IN)='Y' 
:Old_INVH_ENTER_EXT_COST_YN(String[1],IN)='Y' 
:Old_INVH_AP_POSTED_YN(String[1],IN)='N' 
:Old_INVH_GL_POSTED_YN(String[1],IN)='N' 
:Old_INVH_GST_EXEMPT_VENDOR_YN(String[1],IN)='N' 
:Old_INVH_FLAG_1_YN(String[1],IN)='N' 
:Old_INVH_LINE_GST_YN(String[1],IN)='N' 
:Old_INVH_LINE_DISC_YN(String[1],IN)='N' 
:Old_INVH_LINE_SUBSIDY_YN(String[1],IN)='N' 
:Old_INVH_LOCATIONID(LargeInt,IN)=41 
:Old_INH_STATUS_DATE(DateTime,IN)=08-Aug-19 12:25:55 PM 
:Old_INVH_MONEYONLY(Integer,IN)=0 
:Old_INVH_USERID(LargeInt,IN)=1
Processing transaction - Rollback to savepoint LOCK_INVHTBL  [$0C4E2D50] 
Processing transaction - Rollback to savepoint LOCK_INVHTBL  [$0C4E2D50] 
I don't use Tables all that much, preferring Queries, but I would hate to think there is a bug in this area. Can you think of anything else I can check to see why this error is occurring?

Just checked UniDac 7.4.12 with the same code and it does not fail.

ViktorV
Devart Team
Posts: 2838
Joined: Wed 30 Jul 2014 07:16

Re: Post Table error 'Refresh failed. Found 0 records'

Post by ViktorV » Mon 12 Aug 2019 13:48

Unfortunately, we cannot reproduce the problem in our environment based on the data you provide.
Please, compose a small sample demonstrating the described behavior and send it to us using the contact form https://www.devart.com/company/contactform.html including scripts for creating and populating database objects.

Post Reply