cancel
Showing results for 
Search instead for 
Did you mean: 

Snaplogic SQLServer Insert Snap

Jagdish_Manikon
New Contributor

Hi the snaplogic insert snap is throwing error when a trigger task is invoked and the FileId is coming as the parameter.

The error is below

java.sql.BatchUpdateException: Invalid column name ‘FileId’.
at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:1069)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.jooq.tools.jdbc.DefaultStatement.executeBatch(DefaultStatement.java:93)
at org.jooq.impl.BatchSingle.executePrepared(BatchSingle.java:239)
at org.jooq.impl.BatchSingle.execute(BatchSingle.java:182)
at com.snaplogic.snap.api.sql.operations.JdbcOperationsImpl.flushBatch(JdbcOperationsImpl.java:1385)
at com.snaplogic.snaps.sql.SimpleSqlExecuteSnap.flushBatch(SimpleSqlExecuteSnap.java:401)
at com.snaplogic.snaps.sql.SimpleSqlExecuteSnap.handle(SimpleSqlExecuteSnap.java:281)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.callback(SnapRunnableImpl.java:810)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:520)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:839)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.access$000(SnapRunnableImpl.java:115)
at com.snaplogic.cc.snap.common.SnapRunnableImpl$1.run(SnapRunnableImpl.java:362)
at com.snaplogic.cc.snap.common.SnapRunnableImpl$1.run(SnapRunnableImpl.java:358)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:357)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:115)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Instead of doing a trigger task if i put the json generator and pass the values its inserting.

FileId is the foreign Key in the table i am inserting.
Any suggestions on this issue thank you

1 REPLY 1

psathyanarayan
Employee
Employee

I am not sure what is going on in the pipeline since I cannot see it. But based on the error message, I can say that the target table of insert which happens to be the foreign table (since it has FileId has the foreign key) does not seem to have the column “FileId”.

The reason your json generator might be working is that it is not passing the column name explicitly in the insert statement. Normally databases allow default values to be inserted into column if a positional values insert syntax is used rather an parameterized values construct based insert statement (if value is not specified) in which case it will not look for the column name, but based on the position, it will add a default value which may be null or whatever value is specified.

If you can send sql statement, I can take a look.