$stm = "insert into glossary (term_id, definition, state) values (seq_document_id.NEXTVAL,?,?) returning term_id into ?"; $sth = $dbh->prepare($stm); $sth->execute($rows->[$num][1], state($rows->[$num][2]), $value); die unless ($value);