# Comments Panel error

**URL:** <https://forum.inductiveautomation.com/t/comments-panel-error/6885>\
**Category:** Ignition\
**Created:** [July 18, 2013, 2:14pm UTC](https://forum.inductiveautomation.com/t/comments-panel-error/6885 "2013-07-18T14:14:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [July 18, 2013, 2:14pm UTC](https://forum.inductiveautomation.com/t/comments-panel-error/6885/1 "2013-07-18T14:14:19Z")

</div>

I'm trying to configure a comments panel, my notes table is as follows:

[ID] [int] NULL,  
[WhoID] [varchar](1000) NULL,  
[TStamp] [datetime] NULL,  
[Note] [varchar](max) NULL,  
[Filename] [varchar](max) NULL,  
[Sticky] [int] NULL

Although I've tried a lot of things, I always get the same error:

com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: SQL error for "INSERT INTO Notes (Note, WhoID, TStamp, Attachment, Filename, Sticky) VALUES (?, (SELECT Id FROM Users WHERE Username='admin'), CURRENT\_TIMESTAMP, ?, ?, ?)": El valor no está configurado para el número de parámetro 3.  
 at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.newGatewayException(GatewayInterface.java:313)  
 at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:287)  
 at com.inductiveautomation.ignition.client.gateway\_interface.GatewayInterface.sendMessage(GatewayInterface.java:244)  
 at com.inductiveautomation.factorypmi.application.components.PMICommentsPanel.doAddNewNote(PMICommentsPanel.java:273)  
 at com.inductiveautomation.factorypmi.application.components.PMICommentsPanel.access$300(PMICommentsPanel.java:79)  
 at com.inductiveautomation.factorypmi.application.components.PMICommentsPanel$AddNotePanel.actionPerformed(PMICommentsPanel.java:601)  
 at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)  
 at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)  
 at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)  
 at javax.swing.DefaultButtonModel.setPressed(Unknown Source)  
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)  
 at java.awt.Component.processMouseEvent(Unknown Source)  
 at javax.swing.JComponent.processMouseEvent(Unknown Source)  
 at java.awt.Component.processEvent(Unknown Source)  
 at java.awt.Container.processEvent(Unknown Source)  
 at java.awt.Component.dispatchEventImpl(Unknown Source)  
 at java.awt.Container.dispatchEventImpl(Unknown Source)  
 at java.awt.Component.dispatchEvent(Unknown Source)  
 at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)  
 at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)  
 at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)  
 at java.awt.Container.dispatchEventImpl(Unknown Source)  
 at java.awt.Window.dispatchEventImpl(Unknown Source)  
 at java.awt.Component.dispatchEvent(Unknown Source)  
 at java.awt.EventQueue.dispatchEventImpl(Unknown Source)  
 at java.awt.EventQueue.access$200(Unknown Source)  
 at java.awt.EventQueue$3.run(Unknown Source)  
 at java.awt.EventQueue$3.run(Unknown Source)  
 at java.security.AccessController.doPrivileged(Native Method)  
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)  
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)  
 at java.awt.EventQueue$4.run(Unknown Source)  
 at java.awt.EventQueue$4.run(Unknown Source)  
 at java.security.AccessController.doPrivileged(Native Method)  
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)  
 at java.awt.EventQueue.dispatchEvent(Unknown Source)  
 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)  
 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)  
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
 at java.awt.EventDispatchThread.run(Unknown Source)  
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: El valor no está configurado para el número de parámetro 3.  
 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildParamTypeDefinitions(SQLServerPreparedStatement.java:260)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.buildPreparedStrings(SQLServerPreparedStatement.java:219)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doPrepExec(SQLServerPreparedStatement.java:596)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:384)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)  
 at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)  
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)  
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)  
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)  
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:306)  
 at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)  
 at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRPreparedStatement.executeUpdate(SRConnectionWrapper.java:815)  
 at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.RunPrepStmt.runUpdateQuery(RunPrepStmt.java:70)  
 at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.AbstractUpdateQuery.run(AbstractUpdateQuery.java:33)  
 at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.AbstractDBAction.invoke(AbstractDBAction.java:76)  
 at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:398)  
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)  
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)  
 at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)  
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)  
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)  
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)  
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)  
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)  
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)  
 at java.lang.Thread.run(null)

What's wrong?

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [July 18, 2013, 6:25pm UTC](https://forum.inductiveautomation.com/t/comments-panel-error/6885/2 "2013-07-18T18:25:55Z")

</div>

You’ll need to include the code you are trying to run. It looks like you are not passing the correct number of parameters to the system.db.runPrepUpdate.

---

<div class="post-metadata">

**Author:** ![jose.granero](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose.granero/32/11190_2.png) [@jose.granero](https://forum.inductiveautomation.com/u/jose.granero)\
**Post date:** [July 19, 2013, 9:45am UTC](https://forum.inductiveautomation.com/t/comments-panel-error/6885/3 "2013-07-19T09:45:36Z")

</div>

Insert Query1: INSERT INTO Notes (Note, WhoID, TStamp, Attachment, Filename, Sticky) VALUES (?, (SELECT Id FROM Users WHERE Username=’%s’), CURRENT\_TIMESTAMP, ?, ?, ?)

Insert Query2: Cleared

Data:SELECT ID  
, WhoID as Username  
, TStamp as TimeStamp  
, Note as NoteText  
, Filename as AttachmentFilename  
, Sticky as Stick  
FROM Notes

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4900b9f7eda485c6b93f85532377d0f7ae3843a9.png)

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [November 22, 2013, 11:43pm UTC](https://forum.inductiveautomation.com/t/comments-panel-error/6885/4 "2013-11-22T23:43:07Z")

</div>

You are using MS SQLServer, so that means that your AttachmentData column must be of type varbinary(MAX), and you will have to change your Insert Query to use `CAST(? as varbinary(max))` instead of the second question mark.
