AnsweredAssumed Answered

Gel script -Reading csv file and passing the o/p  to sql script

Question asked by uk3373 on Dec 1, 2014
Latest reply on Dec 2, 2014 by uk3373

Hi All,

Could you please help on my below issue .

In this script i am reading csv file then passing the o/p as input to sql script  but from the <gel:out> I am getting the results of the last record in the csv file .My guess here is result variable is holding the last record  from the select statement and its resulting the o/p (<gel:out> of the last record of the csv file.

I have tested by replacing the select with update statement its working fine .

<gel:script xmlns:core="jelly:core"





        <gel:setDataSource dbId="Niku"/>


    <gel:parameter var="vFileName" default="ok1.csv"/>


    <files:readFile fileName="${vFileName}" delimiter="," var="vResourceData" embedded="false"/>


        <core:forEach items="${vResourceData.rows}" var="row" begin="0" end="10">

            <core:set var="A" value="${row[0]}"/>


           <sql:query escapeText="0" var="result">


            SELECT  u.first_name firstName,

                           u.last_name lastName,

                           u.user_name userName

            FROM    cmn_sec_users u

            WHERE  u.user_name in('${A}')




          <core:forEach items="${result.rows}" trim="true" var="row">










Many thanks .



Udaya kumar k