Discussion:
Replication Error
(too old to reply)
d***@njit.edu
2007-09-28 15:42:11 UTC
Permalink
I updated a row in on of my tables in the source database and I am trying to replicate the change to the target database. I did not make any schema changes or anything like that. I am getting error :-

*** SQL ERROR ***: SQL0518N The statement named in the EXECUTE statement is not in a prepared state or is a SELECT or VALUES statement. SQLSTATE=07003

DOUPD: update_string is UPDATE "BLOTTER"."INS_COMPANY" SET
------------ Sqlda for UPDATE (DOUPD:4) -----------
sqldaid:
+00000000 38431907 6848f306 |8C hH? |
sqldabc: 1952
sqln: 44
sqld: 3
SQLVAR[0].sqltype: 448
SQLVAR[0].sqlind = none (even SQLTYPE)
SQLVAR[0].sqllen: 30,
sqlvar[0].sqldata:
+00000000 1d004669 72737420 496e7665 73746f72 | XYZ|
+00000010 73204c69 66652049 6e732e20 436f |Life Ins. Co |
SQLVAR[0].sqlname.length: 11
sqlvar[0].sqlname.data:
+00000000 494e535f 434f4d50 414e59 |INS_COMPANY |
SQLVAR[1].sqltype: 448
SQLVAR[1].sqlind = none (even SQLTYPE)
SQLVAR[1].sqllen: 30,
sqlvar[1].sqldata:
+00000000 13005661 72696162 6c65204c 69666520 | Some Life|
+00000010 28495350 29182f47 607a95b1 ceec |(ISP) /G`zò??? |
SQLVAR[1].sqlname.length: 4
sqlvar[1].sqlname.data:
+00000000 54595045 |TYPE |
SQLVAR[2].sqltype: 484
SQLVAR[2].sqlind = none (even SQLTYPE)
SQLVAR[2].sqllen: 2,
sqlvar[2].sqldata:
+00000000 001c | |
SQLVAR[2].sqlname.length: 5
sqlvar[2].sqlname.data:
+00000000 4f524445 52 |ORDER |
DOUPD: sqlstate is 07003. sqlcode is -518.
DOUPD: TABLE WITH ALL COLS WHICH ARE PART OF THE PRIMARY KEY AND PARTITION_KEYS_
CHG = NO. errcode is CA1107.
SAT: ASNLOAD is null
SAT: FULL_REFRESH is null
SAT: SET_INSERTED = 0
SAT: SET_DELETED = 0
SAT: SET_UPDATED = 0
SAT: SET_REWORKED = 0
SAT: SET_REJECTED_TRXS = 0
SAT: STATUS = -1
SAT: LASTRUN = 2007-09-28-11.36.24.846909
SAT: LASTSUCCESS = 2007-09-28-11.07.02.140306
SAT: SYNCHPOINT is 46fd17b30000001d0000
SAT: SYNCHTIME is 2007-09-28-11.06.50.818617
SAT: SOURCE_ALIAS is BOSS_000
SAT: SOURCE_SERVER is BOSS_000
SAT: SOURCE_OWNER is BLOTTER
SAT: SOURCE_TABLE is INS_COMPANY
SAT: TARGET_ALIAS is BOSS_F03
SAT: TARGET_SERVER is BOSS_F03
SAT: TARGET_OWNER is BLOTTER
SAT: TARGET_TABLE is INS_COMPANY
SAT: SQLSTATE is null
SAT: SQLERRM is null
SAT: SQLCODE is null
SAT: SQLERRP is null
SAT: APPERRM is ASN1011E APPLY "F03" : "WorkerThread". The copy request has inc
ompatible source and target attributes. The SQL co
de is "CA1107".

Can anyone explain to me what is causing this error?

Thanks in advance,

Dev
c***@us.ibm.com
2007-10-12 19:07:09 UTC
Permalink
I think the problem you have hit is that you updated a table where all the attributes are part of the primary key, correct?. The source database is probably not set up to capture 'before images' or to capture updates as delete/insert pairs, correct again?

What I think has happened is that the update has been captured, but using the new values. When Apply tries to make the update the row could not be found on the target database. Apply should convert the apply to insert, but that may violate an FK that you have set, so it breaks.

If you can do a full refresh of that set/table, it will correct the problem by synchronizing with the source again. If you cannot, surgically remove the offending row, or make the update in the target. You should be able to find the transaction causing the problem in the CD table (remember to sort the result set).

- Bill -

Continue reading on narkive:
Loading...