This is with oracle 11. Using Oracle DBD 1.17 (I know it's ancient,
but this used to work)
broken part:
$sq_newinst = "insert into institution (instid, inst_name,
$insttype) values (institution_seq.nextval, '$newinstname', 'Y')
returning instid into :INSTIDNO";
$lda->{AutoCommit} = 1;
$csr = $lda->prepare($sq_newinst);
if ( $ora_errstr ) {
print &PrintHeader;
print "$ora_errstr\n";
print "$sq_newinst\n";
exit;
}
$newinstid=0;
$csr->bind_param_inout(":INSTIDNO",\$newinstid,10);
$csr->execute();
If I run the above code, the insert happens, but nothing but 'instid'
is inserted, which is appropriately returned. My script ends with
"Institution $inst_name added instid = $newinstid"
And both the name and new ID number are correctly returned. But the
values for inst_name and $insttype (which is one of three different
institution type columns) are not insterted, only the
institution_seq.nextval.
This is the sql code that is passed to the database:
insert into institution (instid, inst_name, is_zoo) values
(institution_seq.nextval, 'Roadrunner Zoo of The Canyons', 'Y')
returning instid into :INSTIDNO
So I know it's going out.
If I omit the 'returning instid into :INSTIDNO' part of the clause,
the insert happens correctly.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs