I just tried using it with the default data source and it almost worked.
SQL server is rejecting the attachment. I have that column set up as a varbinary(max), which I think should correspond to a BLOB. I tried putting a convert statement into the insert query, but it didn’t like the syntax.
Any tips on getting this to work with SQL Server?
My original insert:
[color=#0000FF]INSERT INTO Notes (NoteText, UserName, Timestamp, Attachment, AttachmentFilename, Stick) VALUES (?, ‘%s’, CURRENT_TIMESTAMP, ?, ?, ?)[/color]
Gives this error:
[color=#FF0000]GatewayException: Gateway Error 301: SQL error for “INSERT INTO Notes (NoteText, UserName, Timestamp, Attachment, AttachmentFilename, Stick) VALUES (?, ‘admin’, CURRENT_TIMESTAMP, ?, ?, ?)”: Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.
caused by SQLServerException: Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query.
Ignition v7.2.5-beta3 (b63)
Java: Sun Microsystems Inc. 1.6.0_24[/color]
Then I tried this insert:
[color=#0000FF]INSERT INTO Notes (NoteText, UserName, Timestamp, Attachment, AttachmentFilename, Stick) VALUES (?, ‘%s’, CURRENT_TIMESTAMP, (CONVERT(varbinary(MAX),?), ?, ?)[/color]
which caused a syntax error.
Attachments aren’t really required in this application. Is there a way to turn that feature off so I don’t have to worry about it in the queries?
Thanks.