in reply to DBI + Bind

Hi Kevman,

DBI->trace() might supply this info for you - I'm not sure. Have a try and see.

http://search.cpan.org/doc/TIMB/DBI-1.25/DBI.pm#trace

hth, andy.

Replies are listed 'Best First'.
Re: Re: DBI + Bind
by Kevman (Pilgrim) on Jun 06, 2002 at 14:56 UTC

    Thanks Andy,

    That worked a treat...
    Only problem I have now is bind doesnt appear to
    work very well with NULLS in an update statement

    Anyone tried binding NULL values in an update???
    I ended up wrapping an ISNULL around loads of fields :(
    Not ideal......

    Kevman

      Thats Exactly the problem.

      I pass in an array to fill in all the bind variables

      Some of the array is undef (ie NULL).

      So when it reaches these it bombs out.

      The only cure I had was to look at whether a field was
      NULLABLE, and translate the code...

      Ie UPDATE TABLE
      SET ISNULL(field, "ZZZ") = ?

      Then translate the undefs to ZZZ.... Not pretty

      Kevman
      I'm not quite sure what you mean. Are you saying you pass undef as a bind variable and it doesn't fill in NULL? It should.