Announcement

Collapse
No announcement yet.

gen_lookup.first() has skip first value from result

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

  • gen_lookup.first() has skip first value from result

    I was using this code something else (Comparsion) when i use gen_lookup.first(); it always skip first row from result value . Please advice .

    =========================

    var field1,field2,value1,value2,value3;
    var sql="select M.lookup_value AS VITALS_ID, M.FIELD2 AS MACHINE_VITALS,M.FIELD3 AS MACHINE_UNIT,V.lookup_value AS VITALS,V.FIELD1 AS VITALS_UNIT from emr_lookup M JOIN emr_lookup V ON M.lookup_value = V.emr_lookup_id where M.lookup_type = 'VITAL SIGNS HL7 CHANNEL MAPPING' AND V.lookup_type='VITAL SIGNS' AND M.ISVALID=1 AND V.ISVALID=1 AND M.FIELD1='1'";
    var gen_lookup= Fun_Select(sql);
    gen_lookup.first();
    while(gen_lookup.next())
    {
    value1=gen_lookup.getString('MACHINE_VITALS').trim ();
    value2=gen_lookup.getString('MACHINE_UNIT').trim() ;
    value3=gen_lookup.getString('VITALS').trim();
    logger.info("vALUE FROM DB" + value1 +"==="+ value2 +"===="+value3);

    }

  • #2
    gen_lookup.first() move the cursor to the first row, then gen_lookup.next() moves you to the second row.

    You normally don't need to call gen_lookup.first(), and you can probably remove that line.

    Comment

    Working...
    X