Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-3087

queryExecute with a param where "scale" is specified will throw an error

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.2.1.000
    • Fix Version/s: 4.3.0.000, 4.2.1.001
    • Labels:
      None

      Description

      using a query execute statement such as the following, where the scale attribute is specified in a param:

      queryExecute( "UPDATE MyTable SET DecimalColumn = ?", [

      { value: 2.95, cfsqltype: "cf_sql_decimal", scale: 2 }

      ],

      { datasource: "mssql" }

      );

      will result in an error:

      Can't cast Null value to value of type [number]
      at railo.runtime.op.Caster.toIntValue(Caster.java:734):734
      at railo.runtime.tag.util.QueryParamConverter.fill(QueryParamConverter.java:102):102
      at railo.runtime.tag.util.QueryParamConverter.toSQLItem(QueryParamConverter.java:67):67
      at railo.runtime.tag.util.QueryParamConverter.convert(QueryParamConverter.java:46):46
      at railo.runtime.tag.Query.doEndTag(Query.java:467):467
      at queryexecute_cfm$cf.udfCall(/queryExecute.cfm:33):33

      This is not a major problem and easy to work around, as Railo does not need scale specified to correctly pass the parameter to the database. But ColdFusion will not pass decimals (specified with cfsqltype = 'cf_sql_decimal') properly without the scale attribute, so it is a minor issue with cross platform compatibility.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                jcberquist John Berquist
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: