Note that there are some explanatory texts on larger screens.

plurals
  1. POOperand type clash: varbinary is incompatible with text
    primarykey
    data
    text
    <p>I have a file upload control by which user can upload image file to database table.</p> <p>currently i am using to RDBMS 1)Postgresql and 2) SQL server </p> <p><strong>in my postgres database table column for file i use datatypeas bytea in my sql server database table column for file i use datatype as text</strong></p> <p>this is my method </p> <pre><code>public void uploadRentProofDeclaration(final MultipartFile declarationForm, final int rentProofInfoId, int year) { String updateSql = "update plit_landlordinfo" + year + " set filename=?,declarationform=? where cid=?"; getJdbcTemplate().execute(updateSql, new PreparedStatementCallback() { public Object doInPreparedStatement( final PreparedStatement pSstatement) throws SQLException, DataAccessException { pSstatement.setString(1, declarationForm.getOriginalFilename()); try { pSstatement.setBinaryStream(2, new ByteArrayInputStream( declarationForm.getBytes()), declarationForm .getBytes().length); } catch (IOException e) { e.printStackTrace(); } pSstatement.setInt(3, rentProofInfoId); pSstatement.execute(); return null; } }); } </code></pre> <p>this code is working fine with postgresql as well as oracle also but when i my trying to upload image file in sql server i am getting this error.</p> <pre><code>org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [update plit_landlordinfo2011 set filename=?,declarationform=? where cid=?]; Operand type clash: varbinary is incompatible with text; nested exception is java.sql.SQLException: Operand type clash: varbinary is incompatible with text </code></pre> <p>can any one help me where i am doing wrong and what is the solution</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload