Announcement

Collapse
No announcement yet.

'msg' not defined

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

  • 'msg' not defined

    Hi,

    I created a transformer step to process multiple NK1
    segments based on the example for multiple OBX's.
    I am getting an exception for the 'msg' object saying
    it is not defined.

    So, where does 'msg' come from and where should it be defined?

    Cheers,
    Y



    Code:
    var driver = "org.postgresql.Driver"; 
    var address = "jdbc:«»postgresql://localhost:5432/XXXXXXXX"; 
    var username = "XXXXXXXX"; 
    var password = "XXXXXXXX"; 
    
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection(driver,address,username,password); 
    for (var i = 0; i < msg['NK1'].length(); i++)
    {
        var params = new java.util.ArrayList();
        params.add($('relation_clinic'));
        params.add($('relation_name'));
        params.add($('relation_relationship'));
        params.add($('relation_employer'));
        params.add($('relation_postal_code'));
        params.add($('relation_province'));
        params.add($('relation_address'));
        params.add($('relation_city'));
        params.add($('relation_home_phone'));
        params.add($('relation_work_phone'));
        params.add($('relation_work_ext'));
    
        var expression = "INSERT IGNORE INTO relations(patient_id,clinic,name,relationship,employer,postal_code,province,address,city,home_phone,work_phone,work_ext,comment,created_at,updated_at) VALUES ((SELECT currval('patients_id_seq')),?,?,?,?,?,?,?,?,?,?,?,'',now(),now())";
    
        dbConn.executeUpdate(expression,params);
    
        dbConn.close();
    }
Working...
X