Subject | Simple post edited data to table raises exception after converting FB 2.1 to FB 3.0 |
---|---|
Author | |
Post date | 2017-07-19T22:18:20Z |
The error states: Exception class EFDDBEngineException with message
[FireDAC][Phys][FB_30]-312 Exact update affected [0] rows, while [1] was
requested.
If I hit "Continue" button then another exception raises:
The error states: Exception class EFDException with message
[FireDAC][Phys][FB_30]-400 Update command updated [0] rows, instead of
[1] record. Possible reasons: update does not have PK or row identifier,
record has been changed/deleted by another user.
The table has PK as company id, no null value, unique key, I used DB on
my computer so nobody can use it. Without debugger no exception raised.
Under FB 2.1 the same function executed OK.
Data is not saved under debug! Under exe mode no exception raised but data not saved.
This is really really BIG PROBLEM!
Extraction from tracing file:
==========================
--- new start of FireDAC Trace ---
70877486142 15:30:33.779 -=#!!! FireDAC Tracer started !!!#=-
70877486275 15:30:33.779 >> StartTransaction [ConnectionDef="FB_GENESIS_LOCAL"]
70877486367 15:30:33.779 . isc_start_multiple [count=1, params="write,read_committed,rec_version,nowait"]
70877492877 15:30:33.781 << StartTransaction [ConnectionDef="FB_GENESIS_LOCAL"]
70877497615 15:30:33.782 >> TFDCustomCommand.Prepare [Command="SELECT A.*, A.RDB$DB_KEY AS FD__DB_KEY
FROM COMPANY A
"]
70877497649 15:30:33.782 . CreateCommand [ConnectionDef="FB_GENESIS_LOCAL"]
70877497835 15:30:33.782 . Preprocessed [CMD="SELECT A.*, A.RDB$DB_KEY AS FD__DB_KEY
FROM COMPANY A
", FROM="COMPANY", VP=0, VPE=0, OBP=0, CK=1]
70877497871 15:30:33.782 << TFDCustomCommand.Prepare [Command="SELECT A.*, A.RDB$DB_KEY AS FD__DB_KEY
FROM COMPANY A
"]
70877502855 15:30:33.784 >> Process [LimitToTable="COMPANY"]
70877502895 15:30:33.784 >> Lock [ARow.Table.Name="COMPANY"]
70877502918 15:30:33.784 << Lock [ARow.Table.Name="COMPANY"]
70877502945 15:30:33.784 >> Update [ARow.Table.Name="COMPANY"]
70877502996 15:30:33.784 . CreateCommand [ConnectionDef="FB_GENESIS_LOCAL"]
70877504605 15:30:33.784 . Preprocessed [CMD="UPDATE COMPANY
SET STREET_1 = ?
WHERE CUST_NO = ? AND COMPANY_NAME = ? AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = ? AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = ? AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = ? AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = ? AND
REP IS NULL AND CREDIT_PROBLEMS = ? AND
DAY_START = ? AND CATEGORY = ? AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = ? AND USE_MAIN4BILL = ? AND
REP_CREDIT = ? AND INDUSTRY IS NULL AND SHIP_TYPE = ? AND
SHIP_NUMBER IS NULL AND SR_NO = ? AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = ?", FROM="", VP=0, VPE=0, OBP=0, CK=7]
70877504648 15:30:33.784 >> ProcessRequest [ARow.Table.Name="COMPANY"]
70877504786 15:30:33.784 >> Prepare [Command="UPDATE COMPANY
SET STREET_1 = :NEW_STREET_1
WHERE CUST_NO = :OLD_CUST_NO AND COMPANY_NAME = :OLD_COMPANY_NAME AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = :OLD_STREET_1 AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = :OLD_COUNTRY AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = :OLD_CUST_TYPE AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = :OLD_CREDIT_APPROVED AND
REP IS NULL AND CREDIT_PROBLEMS = :OLD_CREDIT_PROBLEMS AND
DAY_START = :OLD_DAY_START AND CATEGORY = :OLD_CATEGORY AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = :OLD_CUST_ACTIVE AND USE_MAIN4BILL = :OLD_USE_MAIN4BILL AND
REP_CREDIT = :OLD_REP_CREDIT AND INDUSTRY IS NULL AND SHIP_TYPE = :OLD_SHIP_TYPE AND
SHIP_NUMBER IS NULL AND SR_NO = :OLD_SR_NO AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = :OLD_DB_KEY"]
70877505037 15:30:33.784 . Preprocessed [CMD="UPDATE COMPANY
SET STREET_1 = ?
WHERE CUST_NO = ? AND COMPANY_NAME = ? AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = ? AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = ? AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = ? AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = ? AND
REP IS NULL AND CREDIT_PROBLEMS = ? AND
DAY_START = ? AND CATEGORY = ? AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = ? AND USE_MAIN4BILL = ? AND
REP_CREDIT = ? AND INDUSTRY IS NULL AND SHIP_TYPE = ? AND
SHIP_NUMBER IS NULL AND SR_NO = ? AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = ?", FROM="", VP=0, VPE=0, OBP=0, CK=7]
70877505076 15:30:33.784 . isc_dsql_allocate_statement [db_handle=$00000001]
70877505123 15:30:33.784 . isc_dsql_prepare [tra_handle=$0000003B, stmt_handle=$0000004F, sql="UPDATE COMPANY
SET STREET_1 = ?
WHERE CUST_NO = ? AND COMPANY_NAME = ? AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = ? AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = ? AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = ? AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = ? AND
REP IS NULL AND CREDIT_PROBLEMS = ? AND
DAY_START = ? AND CATEGORY = ? AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = ? AND USE_MAIN4BILL = ? AND
REP_CREDIT = ? AND INDUSTRY IS NULL AND SHIP_TYPE = ? AND
SHIP_NUMBER IS NULL AND SR_NO = ? AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = ?", dialect=3]
70877507063 15:30:33.785 . isc_dsql_sql_info [stmt_handle=$0000004F, info=21]
70877507094 15:30:33.785 . isc_dsql_describe_bind [stmt_handle=$0000004F, dialect=3]
70877507153 15:30:33.785 . isc_dsql_describe_bind [stmt_handle=$0000004F, dialect=3]
70877507305 15:30:33.785 << Prepare [Command="UPDATE COMPANY
SET STREET_1 = :NEW_STREET_1
WHERE CUST_NO = :OLD_CUST_NO AND COMPANY_NAME = :OLD_COMPANY_NAME AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = :OLD_STREET_1 AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = :OLD_COUNTRY AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = :OLD_CUST_TYPE AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = :OLD_CREDIT_APPROVED AND
REP IS NULL AND CREDIT_PROBLEMS = :OLD_CREDIT_PROBLEMS AND
DAY_START = :OLD_DAY_START AND CATEGORY = :OLD_CATEGORY AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = :OLD_CUST_ACTIVE AND USE_MAIN4BILL = :OLD_USE_MAIN4BILL AND
REP_CREDIT = :OLD_REP_CREDIT AND INDUSTRY IS NULL AND SHIP_TYPE = :OLD_SHIP_TYPE AND
SHIP_NUMBER IS NULL AND SR_NO = :OLD_SR_NO AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = :OLD_DB_KEY"]
70877507383 15:30:33.785 >> Execute [Command="UPDATE COMPANY
SET STREET_1 = :NEW_STREET_1
WHERE CUST_NO = :OLD_CUST_NO AND COMPANY_NAME = :OLD_COMPANY_NAME AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = :OLD_STREET_1 AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = :OLD_COUNTRY AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = :OLD_CUST_TYPE AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = :OLD_CREDIT_APPROVED AND
REP IS NULL AND CREDIT_PROBLEMS = :OLD_CREDIT_PROBLEMS AND
DAY_START = :OLD_DAY_START AND CATEGORY = :OLD_CATEGORY AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = :OLD_CUST_ACTIVE AND USE_MAIN4BILL = :OLD_USE_MAIN4BILL AND
REP_CREDIT = :OLD_REP_CREDIT AND INDUSTRY IS NULL AND SHIP_TYPE = :OLD_SHIP_TYPE AND
SHIP_NUMBER IS NULL AND SR_NO = :OLD_SR_NO AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = :OLD_DB_KEY", ATimes=0, AOffset=0]
70877507468 15:30:33.785 >> Sent
70877507514 15:30:33.785 . Var [N=0, Name="NEW_STREET_1", Type=SQL_VARYING, Prec=0, Scale=0, Size=30, Data(0)='123 TEST STREET']
70877507540 15:30:33.785 . Var [N=1, Name="OLD_CUST_NO", Type=SQL_LONG, Prec=0, Scale=0, Size=4, Data(0)=24580]
70877507577 15:30:33.785 . Var [N=2, Name="OLD_COMPANY_NAME", Type=SQL_VARYING, Prec=0, Scale=0, Size=45, Data(0)='TEST']
70877507614 15:30:33.785 . Var [N=3, Name="OLD_STREET_1", Type=SQL_VARYING, Prec=0, Scale=0, Size=30, Data(0)='123']
70877507650 15:30:33.785 . Var [N=4, Name="OLD_COUNTRY", Type=SQL_VARYING, Prec=0, Scale=0, Size=15, Data(0)='USA']
70877507687 15:30:33.785 . Var [N=5, Name="OLD_CUST_TYPE", Type=SQL_VARYING, Prec=0, Scale=0, Size=10, Data(0)='REGULAR']
70877507724 15:30:33.785 . Var [N=6, Name="OLD_CREDIT_APPROVED", Type=SQL_VARYING, Prec=0, Scale=0, Size=3, Data(0)='NO']
70877507755 15:30:33.785 . Var [N=7, Name="OLD_CREDIT_PROBLEMS", Type=SQL_VARYING, Prec=0, Scale=0, Size=3, Data(0)='NO']
70877507800 15:30:33.785 . Var [N=8, Name="OLD_DAY_START", Type=SQL_TIMESTAMP, Prec=0, Scale=0, Size=8, Data(0)=7/17/2017]
70877507827 15:30:33.785 . Var [N=9, Name="OLD_CATEGORY", Type=SQL_LONG, Prec=0, Scale=0, Size=4, Data(0)=1]
70877507865 15:30:33.785 . Var [N=10, Name="OLD_CUST_ACTIVE", Type=SQL_TEXT, Prec=0, Scale=0, Size=1, Data(0)='Y']
70877507895 15:30:33.785 . Var [N=11, Name="OLD_USE_MAIN4BILL", Type=SQL_TEXT, Prec=0, Scale=0, Size=1, Data(0)='Y']
70877507931 15:30:33.785 . Var [N=12, Name="OLD_REP_CREDIT", Type=SQL_TEXT, Prec=0, Scale=0, Size=1, Data(0)='N']
70877507966 15:30:33.785 . Var [N=13, Name="OLD_SHIP_TYPE", Type=SQL_TEXT, Prec=0, Scale=0, Size=1, Data(0)='C']
70877508002 15:30:33.785 . Var [N=14, Name="OLD_SR_NO", Type=SQL_LONG, Prec=0, Scale=0, Size=4, Data(0)=0]
70877508037 15:30:33.785 . Var [N=15, Name="OLD_DB_KEY", Type=SQL_TEXT, Prec=0, Scale=0, Size=8, Data(0)='« '']
70877508057 15:30:33.785 << Sent
70877508071 15:30:33.785 . isc_dsql_execute2 [tra_handle=$0000003B, stmt_handle=$0000004F, dialect=3]
70877508249 15:30:33.785 . isc_dsql_sql_info [stmt_handle=$0000004F, info=23]
70877675160 15:30:33.836 . Array DML failed: [FireDAC][Phys][FB_V30]-312. Exact update affected [0] rows, while [1] was requested
70877675273 15:30:33.836 << Execute [Command="UPDATE COMPANY
SET STREET_1 = :NEW_STREET_1
WHERE CUST_NO = :OLD_CUST_NO AND COMPANY_NAME = :OLD_COMPANY_NAME AND
CONTACT_FIRST IS NULL AND CONTACT_SECOND IS NULL AND PHONE_NO IS NULL AND
STREET_1 = :OLD_STREET_1 AND STREET_2 IS NULL AND CITY IS NULL AND
STATE_PROVINCE IS NULL AND COUNTRY = :OLD_COUNTRY AND POSTAL_CODE IS NULL AND
FAX_NO IS NULL AND STREET_3 IS NULL AND E_MAIL IS NULL AND
CUST_TYPE = :OLD_CUST_TYPE AND BUS_TYPE IS NULL AND LAST_ORDER_DAY IS NULL AND
THIS_YEAR_SALES IS NULL AND LAST_YEAR_SALES IS NULL AND
YEAR_BEFORE_LAST_SALES IS NULL AND REMARKS IS NULL AND LABEL IS NULL AND
PERCENT_DISCOUNT IS NULL AND CREDIT_APPROVED = :OLD_CREDIT_APPROVED AND
REP IS NULL AND CREDIT_PROBLEMS = :OLD_CREDIT_PROBLEMS AND
DAY_START = :OLD_DAY_START AND CATEGORY = :OLD_CATEGORY AND
BILL_COMPANY_NAME IS NULL AND BILL_STREET_1 IS NULL AND
BILL_STREET_2 IS NULL AND BILL_STREET_3 IS NULL AND BILL_CITY IS NULL AND
BILL_STATE_PROVINCE IS NULL AND BILL_POSTAL_CODE IS NULL AND
BILL_COUNTRY IS NULL AND BILL_PHONE_NO IS NULL AND BILL_FAX_NO IS NULL AND
BILL_CONTACT_FIRST IS NULL AND BILL_CONTACT_SECOND IS NULL AND
CUST_ACTIVE = :OLD_CUST_ACTIVE AND USE_MAIN4BILL = :OLD_USE_MAIN4BILL AND
REP_CREDIT = :OLD_REP_CREDIT AND INDUSTRY IS NULL AND SHIP_TYPE = :OLD_SHIP_TYPE AND
SHIP_NUMBER IS NULL AND SR_NO = :OLD_SR_NO AND CREDIT_LINE IS NULL AND
RDB$DB_KEY = :OLD_DB_KEY", ATimes=1, AOffset=0, RowsAffected=0, RowsAffectedReal=True, ErrorAction=0]
70877675542 15:30:33.836 . [FireDAC][DApt]-400. Update command updated [0] instead of [1] record. Possible reasons: update table does not have PK or row identifier, record has been changed/deleted by another user
==========================
Please help, Fred