On Thu, 21 Nov 2002 15:12:47 -0800, Daniel Olson wrote:

>  $sth = $dbh->prepare("insert into ul_info 
>(ul_id,ul_len,ul_wid,ul_dep,ul_tun,ul_sin,ul_und,ul_und_fr,ul_und_to,ul_edge,ul_stat,ul_skin,ul_drain_typ,ul_drain_amt,ul_drain_col,ul_drain_od,ul_stage,timestamp,clinician)
>      values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,sysdate,'')");
>  
>$sth->execute($UlID,$formdata->param('Len'),$formdata->param('Wid'),$formdata->param('Dep'),$formdata->param('Tun'),$formdata->param('Sin'),$formdata->param('Und'),$formdata->param('UStart'),$formdata->param('UEnd'),$formdata->param('DEdge'),$formdata->param('DEval'),$formdata->param('DSkin'),$formdata->param('DType'),$formdata->param('DAmt'),$formdata->param('DColor'),$formdata->param('DOdor'),$newstage)
> || die "Can't perform execute: $DBI::errstr";
>
>If I run this from the command line and only define three variables, it fails
>with the error:
>
>DBD::Oracle::st execute failed: called with 5 bind variables when 17 are needed at 
>script.cgi line 201.

You shouldn't just drop undefined values. Pass undef instead. DBI will
insert NULL for those values.

-- 
        Bart.

Reply via email to