in reply to DBI error Can't mix placeholder styles (:foo/?)

Change the ":id" in your SQL to a ? and change the bind_param_inout calls first argument to 4. You cannot mix placeholder styles.

  • Comment on Re: DBI error Can't mix placeholder styles (:foo/?)

Replies are listed 'Best First'.
Re^2: DBI error Can't mix placeholder styles (:foo/?)
by Anonymous Monk on Jun 21, 2011 at 09:37 UTC
    I get a different error after that change:
    DBD::Oracle::st execute failed: called with 3 bind variables when 4 ar +e needed
    my $insql = " INSERT INTO PROGTBL (cola, colb, colc ) VALUES ( ?, ?, ?) RETURNING PROGID INTO ? "; my $sth = $self->dbh->prepare($insql) or die "Can't prepair statem +ent: $self->DBI::errstr"; $sth->bind_param_inout(4, \my $new_id, 99); $sth->execute( $foo, $bar, $baz)

      Yes, sorry. You need to bind the input parameters by calling bind_param().

        Thank you. Must I bind each indicidually, e.g.
        $sth->bind_param(1, $foo); $sth->bind_param(2, $bar); ....