Oracle record update feature not available
suganyp07 opened this issue · 1 comments
I am using this plugin, Oracle instant client, ruby-oci8 and activerecord-oracle_enhanced-adapter.
Below is the configuration used:
<match oracle.input>
@type sql
host xxx.xxxxxx.xxxxx.xxxx.net
port 1555
database test
adapter oracle_enhanced
username xxxxxxxxxx
password xxxxxxxxxx
<table>
table reg_as_data
column_mapping 'tn:tn,regtime:regtime,domain:domain,scscf:scscf,pcscf:pcscf,deviceip:deviceip,devicename:devicename,subscribertype:subscribertype,hss:hss,expires:expires,devicemac:devicemac,provgroup:provgroup,cmts:cmts,account_no,account_no,sub_id:sub_id,zipcode:zipcode,icmp_ping:icmp_ping,sip_ping:sip_ping'
</table>
</match>
In 'reg_as_data' table, 'tn' is the primary key.
With this setup, records are inserted into the table. However, when the same 'tn' sends updated data, the record is not getting updated. Error details given below for reference.
2019-06-07 11:05:03 +0000 [error]: #0 Got deterministic error again. Dump a record error_class=ActiveRecord::RecordNotUnique error="OCIError: ORA-00001: unique constraint (PDBADMIN.SYS_C0012535) violated: INSERT INTO \"REG_AS_DATA\" (\"TN\",\"REGTIME\",\"DOMAIN\",\"SCSCF\",\"PCSCF\",\"DEVICEIP\",\"DEVICENAME\",\"SUBSCRIBERTYPE\",\"HSS\",\"EXPIRES\",\"DEVICEMAC\",\"PROVGROUP\",\"CMTS\",\"ACCOUNT_NO\",\"SUB_ID\",\"ZIPCODE\",\"ICMP_PING\",\"SIP_PING\") VALUES ('2011010086',' 1559905418','xxxxxxx','scscfman2','pcscfman2','21.168.211.17','Load-Test1','BCV','hssman1','3600','mACB313E2ECCA','phil1',NULL,NULL,NULL,NULL,NULL,NULL)" record=#<Fluent::Plugin::SQLOutput::BaseModel_897089696::RegAsDatum tn: 0.2011010086e10, regtime: 0.1559905418e10, domain: "xxxxxxx", scscf: "scscfman2", pcscf: "pcscfman2", deviceip: "21.168.211.17", devicename: "Load-Test1", subscribertype: "BCV", hss: "hssman1", expires: 0.36e4, devicemac: "mACB313E2ECCA", provgroup: "phil1", cmts: nil, account_no: nil, sub_id: nil, zipcode: nil, icmp_ping: nil, sip_ping: nil>
Are there any configurations available to update records in ORACLE DB?
Thank you.
Are there any configurations available to update records in ORACLE DB?
From the README, activerecord-import is not supported.
https://github.com/zdennis/activerecord-import/#duplicate-key-update
So hard to support upsert for Oracle in this plugin for now. I'm not sure AR 6's batch import supports upsert or not.