in reply to DBI:Problem in binding VARCHAR values to statement

bind_param() is used to retrieve values. Placeholders are used to supply values. They are completely different.

I suspect you will have better results with:

$sth_DNTM->execute($cd_typ, $num_org); @row = $sth->fetchrow_array();
If you used bind_param(), you wouldn't need to assign anything to @row, and you would use fetch() instead. See perldoc DBI for more details.

Update: chipmunk is right, I'm thinking of bind_columns(). Sorry about that! My guess is on the missing 'WHERE' SQL keyword.

Replies are listed 'Best First'.
Re: Re: DBI:Problem in binding VARCHAR values to statement
by chipmunk (Parson) on May 07, 2001 at 06:52 UTC
    That's really not correct. bind_param() is used to bind values to placeholders ahead of time, instead of in the execute() call. bind_param_inout() is like bind_param(), but also allows values to be set by the call to fetch().

    While your example code is fine, the code that the original poster wrote using bind_param() should work just as well.

    See the DBI documentation for more details.