monks, please advise
$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);
the statement inserts into the db, but returns a null value to $value. From querying the db, i know that term_id is being successfully updated with seq_doc_id.NEXTVAL, but for some reason the 'returning into' part does not want to behave, and keeps giving me null values. what am i doing wrong?
UPDATE: Thanks for the advice, folks. Found out the resolution. The best way to do it was to use
$sth->bind_param(1,$variable) $sth->bind_param(2,$variable) $sth->bind_param_inout(3,\$value,max_length) $sth->execute();
thanks to ruzam for clarifying that execute() is a one-way communication channel, that was the key for me to find the solution. much appreciated
In reply to DBI help please by TendulkarIsGod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |