The problem with using the execute to call the variables, is that the last one

is bind_param_inout.  I don't know of a way to tell the execute call that it
needs to put a value in that parameter.

But, just for testing sake, I put all the variables in the execute.  I did

$patient_title = $dbh->quote($patient_title);

before the execute.  The program did not core dump this time, and it inserted
the row, but to my great surprise, it inserted the word NULL instead of the
value NULL.

I am using Perl 5.6.0 on linux and DBI 1.15.

Sherry Graham
[EMAIL PROTECTED]

Curt Russell Crandall wrote:

> I'm bad.  I didn't see that you were using bind_param.  You don't want to
> quote and then use bind_param.  Either quote and then put your argument
> list into the call to execute or maybe try defining the variable type in
> bind_param... seemed like that helped me in one instance to keep undefs
> from causing SEGV signals.
>
> What version of Perl and DBI are you using... like I said earlier, an
> upgrade to the latest and greatest cured the problem.
>
> --Curt
>
> On Tue, 8 May 2001, Sherry Graham wrote:
>
> > I am using DBD::ASAny.  I am calling a stored procedure to insert rows
> > into a table. Some of the parameters that I want to pass might have null
> > in them, but I am having trouble using a variable and place holder that
> > has the value undef.  It keeps core dumping.  Here is the code that I'm
> > working with. What am I missing?
> >
> > $first_name = 'sherry';
> > $last_name = 'graham';
> > $middle_initial = 'a';
> > $patient_title = undef;
> > $sth = $dbh->prepare('call add_person (?, ?,?,?,?)');
> > $sth->bind_param(1,$first_name);
> > $sth->bind_param(2,$last_name);
> > $sth->bind_param(3,$middle_initial);
> > $sth->bind_param(4,$patient_title);
> > $sth->bind_param_inout(5,\$person_id,500);
> > $sth->execute();
> >
> > Thanks!
> > Sherry Graham
> > [EMAIL PROTECTED]
> > Applied Systems Intelligence, Inc.
> >
> >

Reply via email to