Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
When using JMLC to set scalar string values, the values are not automatically treated as strings as a result of calling setScalar with a string value.
For example, take the following DML:
inScalar1 = read("./tmp/doesntexist1", data_type="scalar", value_type="string"); inScalar2 = read("./tmp/doesntexist2", data_type="scalar", value_type="string"); print(inScalar1 + inScalar2);
The above will be treated correctly. However, the following won't be treated correctly:
inScalar1 = read("./tmp/doesntexist1", data_type="scalar"); inScalar2 = read("./tmp/doesntexist2", data_type="scalar"); print(inScalar1 + inScalar2);
(this will output "0.0")
Calling PreparedScript's setScalar with a String should automatically resolve to a String.
Connection conn = new Connection(); String str = conn.readScript("scalar-input-string.dml"); PreparedScript script = conn.prepareScript(str, new String[] { "inScalar1", "inScalar2" }, new String[] {}, false); String inScalar1 = "hello"; String inScalar2 = "goodbye"; script.setScalar("inScalar1", inScalar1); script.setScalar("inScalar2", inScalar2); script.executeScript();
This should produce "hellogoodbye" rather than "0.0" with both DML examples.