Updating columns in a row at a time
Posted in 1998
Topics: General Discussion
Hello all, Here's one I've been posting to DBI group and don't have a resolution on yet. I'm using DBI and DBD::Informix on a DEC Alpha OSF Unix box. (I believe my version of Informix is 7.2, or 7.3 . . something like that) I'm updating a table from form_data input. I don't know which of the fields will be updated, so I'm reading their current listing into the form, then allowing for the update. I have dropdown boxes that are dynamically generated from other tables in the same database. After changes are made and choices are made in the dropdown boxes, I need the row that belongs to this info, updated. I must be missing something little. Here's what I've gotten so far. (Note: I can get the $st1, $wc and $row to print back hashes and arrays, so it has to be something with the $st2.) Here we go: # part of my form_data gets put into a bind statement above, that's where the @bind comes from. $st1 = $dbh->prepare("select * from $table for update"); $wc = $st1->{CursorName}; $st2 = $dbh->prepare ("update $table set (name_last, name_first, degree, title, research, phone_office, phone_dept, phone_home, email_addr, homepage, expertise_1, expertise_2, contact_print, contact_video, photo_release, language_1, language_2, language_3, language_4, language_5, language_6, general_1, specific1_1, specific1_2, specific1_3, specific1_4, specific1_5, general_2, specific2_1, specific2_2, specific2_3, specific2_4, specific2_5)=(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?) where id = ? $wc") || die "Failed to prepare '$st2'\\n"; $st1->execute; $row = $st1->fetch; $st2->execute (@bind, $id); I sure hope somebody can help. I'm at a standstill. Thanks, Dave