matpj

Taking GEL query results and writing each row to a new table.... how to do

Discussion created by matpj on Oct 12, 2010
Latest reply on Oct 12, 2010 by Dave
I have a script that reads from ppa_wip, and inserts the results into a new table.I want to be able to do it quickly, cos at the moment it is taking a lifetime going through each result row and INSERTING to the table.I'm not sure if my is adding a lot of time to this - as I just wanted to check in the console that it was doing something.  can anyone suggest a more efficient way of performing this?  here is my script: gel:script xmlns:core =" jelly:core " xmlns:define =" jelly:define "  xmlns:gel =" jelly:com.niku.union.gel.GELTagLibrary "  xmlns:sql =" jelly:sql ">     gel:parameter var =" Entity " default =" DSTUK "/>   gel:parameter var =" StartDate " default =" 01-01-2008 "/>   gel:parameter var =" EndDate " default =" 01-07-2009 "/>     sql:setDataSource driver =" oracle.jdbc.driver.OracleDriver " password =" niku " url =" jdbc:odbc:nikutest " user =" niku " var =" Cn_Clarity "/>     sql:query var =" result " dataSource =" ${Cn_Clarity} ">  Select to_char(transno) as TRANSACTION, transdate from niku.ppa_transcontrolwhere entity = 'DSTUK' and (transdate between to_date('${StartDate}', 'dd/mm/yyyy') AND sysdate)and transno not in (select transno from niku.dsti_gl_control)   sql:query >  core:forEach indexVar =" i " items =" ${result.rowsByIndex} ">  sql:update dataSource =" ${Cn_Clarity} ">  INSERT INTO niku.dsti_gl_control (transno)VALUES ('${result.rows[i].TRANSACTION}')    sql:update >     gel:out > ${result.rows[i].TRANSACTION} gel:out >      core:forEach >      gel:script >      any help will be appreciated.  Regards,Matt Message Edited by matpj on 07-17-2009 06:42 AM [left] Message Edited by matpj on 07-17-2009 06:43 AM [left]

Outcomes