So I scaned all your other posts in this thread and all I found was that you said in the root one that you are using MS SQL Server 2000 (I admit asking you for the value of @@VERSION would be pointless, there is no need for that level of detail in this case) and ... in one of the responses ... that you are using DBD::ODBC.

I asked you to tell us the VERSIONS of the modules! And ... guess what ... they are nowhere to be found in the whole thread. Maybe the bug (if there is any) was alerady fixed in a newer version than the one you have. Maybe not, but how do we know?

BTW, want some code? OK

use DBI; our $db; our %sp; sub open_db { return if $db and $db->{'Active'}; Log "\nConnecting to the database"; eval { $db = DBI->connect('dbi:ODBC:Driver=SQL Server;Server=JobVIPeR +;Database=XxxXXXxX', 'xxx', 'xxx', {PrintError => 0,RaiseError => 1,LongReadLen => 65536,Auto +Commit => 0}); }; if (! $db) { Log("\tCannot connect to the database! : $DBI::errstr"); return; } Log "\tConnected"; prepare_sps(); } sub prepare_sps { $sp{SetDirty} = $db->prepare('EXEC dbo.SetInt ?, 1'); #... } #... $sp{SetDirty}->execute($objname."_dirty"); #...
If you want to use placeholders for OUTPUT parameters than that's a bit more complex. You have to use bind_param_inout() for that, something like:
my $import = $db->prepare_cached('EXEC dbo.ImportClient ?, ?, ?, ? +, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?'); db_error("compiling ImportClient",$db) if !$import; my $WasNew = 0; $import->bind_param_inout( 15, \$WasNew, 1); #... my $id = 0; $import->bind_param(++$id, $_) for @{$rec->{fields}}{@fields}; if ($import->execute()) { if ($WasNew) { $new++; } else { $updated++; } } else { db_error("updating client '$rec->{fields}->{client_desc}'" +,$db,1); $import->finish(); $incorrect++; } #...

Does this help?


In reply to Re^3: Perl DBI issue by Jenda
in thread Perl DBI issue by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.