Skip to Content
0
Apr 27, 2014 at 03:31 PM

Insert values from array - XSJS

1124 Views

for(var j=0; j<output2.length; j++)

{

var pstmt4 = conn.prepareStatement("INSERT INTO STUDENT01.HISTORY VALUES(?,?,?,?)");

pstmt4.setString(1,date);

pstmt4.setString(2,time);

pstmt4.setString(3,output2[j]); // at this line

pstmt4.setString(4,output);

pstmt4.executeQuery();

}

The above code shows an error while inserting. but works without the loop. Am i missing something?