in reply to Re: DBI help please
in thread DBI help please

didn't work.. , oracle barfed an error message all over my nice clean screen

my changed code:

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

it croaked with

DBD::Oracle::st execute failed: ORA-00925: missing INTO keyword (DBD ERROR: error possibly near <*> indicator at char 108 in 'insert into glossary (term_id, definition, state) values (seq_document_id.NEXTVAL,:p1,:p2) returning term_id<*>')

Replies are listed 'Best First'.
Re^3: DBI help please
by moritz (Cardinal) on Dec 07, 2010 at 21:39 UTC

    Since I never used Oracle, I don't really know how to do it. If nobody else has a better idea, maybe take a look at how DBIx::Class does it - it sure needs to obtain the primary key for an insert.