DatabaseWriter Insert INTO having error

New to CloverDX. I am having an error in DatabaseWriter transformation when doing insert into
I have DBExecute with query selecting from transactions table, using transactions metadata for edge. in DatabaseWrite I have transactions_import

Should they have the same number columns?

My insert into query

INSERT INTO [dbo].[transactions]
([cct_id], )
VALUES
($cct_id, );

I still don’t know how to analyze and read error
but in the link provided i have details below

Failed component type - DB_OUTPUT_TABLE
Error Message: Component [TGT_AMS_TRANSACTIONS_ABI:TGT_AMS_TRANSACTIONS_ABI] finished with status ERROR. (In0: 1 recs)
Maximum # of errors exceeded when writing records to database. Exception thrown by: INSERT INTO AA_Ecommerce.dbo.ams_transactions_import

Exception:

org.jetel.exception.JetelRuntimeException: Component [TGT_AMS_TRANSACTIONS_ABI:TGT_AMS_TRANSACTIONS_ABI] finished with status ERROR. (In0: 1 recs)
at org.jetel.graph.Node.createNodeException(Node.java:673)
at org.jetel.graph.Node.run(Node.java:638)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.jetel.exception.JetelException: Maximum # of errors exceeded when writing records to database. Exception thrown by: INSERT INTO AA_Ecommerce.dbo.ams_transactions_import

Try to look here: DatabaseWriter | CloverDX 6.6.0 Documentation

That is description of how-to use DatabaseWriter - as there are multiple ways you can “define” your insert and how Clover maps input fields onto DB columns.

Also, DBExecute is primarily meant to execute some DDL/DML command - like “create table” or execute stored procedure. Can be used to “read” data from DB, but interacts with DB through a mechanism, which is more suited to those DDL/DML/Exec-stored-procedure statements/commands than classic SELECT.

If you are running SQL query and want to process all returned rows, then DatbaseReader is the way - uses sligtly different API calls and can retrieve data faster.

If your reading already works, no need to change it.

1 Like