Announcement

Collapse
No announcement yet.

conversion of long

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • conversion of long

    I read a value from the database in a transformer. The SQL datatype of this column is bigint.

    Code:
    var Patient_Uid = result.getLong(1);  
    localMap.put("Patient_Uid", Patient_Uid);
    In the destination database writer, I want to write this out to another table.

    Code:
    insert into sometable (Patient_Uid,...) values (${Patient_Uid},...);
    I get the following error message during the execution of the query:

    Code:
    java.sql.SQLException: Error converting to long. 23.0 ...
    In this case, 23 was the bigint value retrieved from the database (Firebird).

    I hacked a solution by forcing the Patient_Uid variable to a string in Javascript as follows:
    Code:
    var Patient_Uid = result.getLong(1) + ''
    This did the trick.

    Is there a better solution than this? My javascript knowledge is moderate at best.

    Thanks.
Working...
X