Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Before insert Trigger

 
Ann Bar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a table that has a before insert trigger. The trigger stores a value from another table in the first column. I include values for all columns minus the first one for my sql insert.

I get the error:
java.sql.SQLException: Missing IN or OUT parameter at index:: 1

I think it means I need to include one more column for the insert. How do I do it for the first column with trigger?

Thanks.

String fields[] = new String[8];
int i = 1;
sql = "INSERT into TBL_LOGS VALUES(?,?,?,?,?,?,?,?)";
PreparedStatement ps = connection.prepareStatement(sql);
//loop
//ps.setString(i+1, fields[i]);
int rs = ps.executeUpdate();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic