Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • SQLDataSource: Invalid column index while updating a blob column

    SmartClient Version: v11.1p_2018-09-07/Enterprise Deployment (built 2018-09-07)
    and
    SmartClient Version: SNAPSHOT_v12.1d_2018-09-10/EVAL Deployment (expires 2018.11.09_07.15.29) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    Tomcat 8.5 and Oracle 12g

    Hello, I've got a table which has only one blob column. In my SQLDataSource I've got that field declared and also another which is based on the same blob field, using a customSelectExpression.
    I use it to show two different columns in a grid, one with showFileInline:true and another with showFileInline:false.

    Code:
    ....
            <field name="LOGO_IMG" type="imageFile"/>
            <field name="LOGO_IMG_FILENAME" type="text"/>
            <field name="LOGO_IMG_FILESIZE" type="integer"/>
            <field name="LOGO_IMG_DATE_CREATED" type="datetime"/>
    
            <field name="LOGO_IMG_FIELD" customSelectExpression="LOGO_IMG" type="imageFile"/>
            <field name="LOGO_IMG_FIELD_FILENAME" customSelectExpression="LOGO_IMG_FILENAME" type="text"/>
            <field name="LOGO_IMG_FIELD_FILESIZE" customSelectExpression="LOGO_IMG_FILESIZE" type="integer"/>
            <field name="LOGO_IMG_FIELD_DATE_CREATED" customSelectExpression="LOGO_IMG_DATE_CREATED" type="datetime"/>
    ....
    when trying to update a record with a new image, I got a SQL error:

    Code:
    2018-09-14 12:11:57,531 DEBUG DSRequest [builtinApplication.null] freeOnExecute is false for request of type fetch on DataSource LEG_SQUADRE - not freeing resources! 
    2018-09-14 12:11:57,532 INFO  SQLValuesClause [builtinApplication.null] Ignoring value for LOGO_IMG_FIELD since it has a customSelectExpression or customSQLExpression but no customUpdateExpression 
    2018-09-14 12:11:57,532 INFO  SQLValuesClause [builtinApplication.null] Ignoring value for LOGO_IMG_FIELD_DATE_CREATED since it has a customSelectExpression or customSQLExpression but no customUpdateExpression 
    2018-09-14 12:11:57,532 INFO  SQLValuesClause [builtinApplication.null] Ignoring value for LOGO_IMG_FIELD_FILENAME since it has a customSelectExpression or customSQLExpression but no customUpdateExpression 
    2018-09-14 12:11:57,532 INFO  SQLValuesClause [builtinApplication.null] Ignoring value for LOGO_IMG_FIELD_FILESIZE since it has a customSelectExpression or customSQLExpression but no customUpdateExpression 
    2018-09-14 12:11:57,532 INFO  SQLDriver [builtinApplication.null] Executing SQL query on 'dbJpcEP' using connection '232188457': UPDATE DBSALES.LEG_SQUADRE SET CODICE_SQUADRA='MN', DESCRIZIONE='AS Monaco FC', FK_REGIONE=22, LOGO_IMG=?, LOGO_IMG_DATE_CREATED=TO_DATE('2018-09-14 12:11:57','YYYY-MM-DD HH24:MI:SS'), LOGO_IMG_FILENAME='MN.png', LOGO_IMG_FILESIZE=8595, LOGO_URL_PREFIX='https://custom-apps.juventus.com/static/images/loghi_squadre/', LOGO_URL_SUFFIX='.png', SERVER_PATH='smb://srvprodilb/static/images/loghi_squadre/' WHERE (LEG_SQUADRE.ID_REC=975393) 
    2018-09-14 12:11:57,537 DEBUG SQLDriver [builtinApplication.null] FAILED to execute SQL update in 'dbJpcEP' using connection'232188457' 
    2018-09-14 12:11:57,537 DEBUG DSRequest freeOnExecute is false for request of type update on DataSource LEG_SQUADRE - not freeing resources! 
    2018-09-14 12:11:57,538 DEBUG DataSourceDMI Invocation threw exception 
    java.sql.SQLException: Indice di colonna non valido
        at oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamInternal(OraclePreparedStatement.java:14350)
        at oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamInternal(OraclePreparedStatement.java:21927)
        at oracle.jdbc.driver.OraclePreparedStatement.setBinaryStream(OraclePreparedStatement.java:21111)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.setBinaryStream(OraclePreparedStatementWrapper.java:2046)
        at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
        at com.sun.proxy.$Proxy35.setBinaryStream(Unknown Source)
        at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:1253)
        at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:1189)
        at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1357)
        at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:598)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1848)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:440)
        at com.isomorphic.sql.SQLDataSource.executeUpdate(SQLDataSource.java:389)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:2425)
        at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:646)
        at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:547)
        at com.isomorphic.application.AppBase.execute(AppBase.java:490)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2835)
        at com.juve.legend.SquadreDMI.salvaLogoSquadra(SquadreDMI.java:91)
    'Indice di colonna non valido' means 'Invalid column index'
Working...
X