• Post Reply Bookmark Topic Watch Topic
  • New Topic

Before insert Trigger  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?


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