From: "Charles Lawrence" <[EMAIL PROTECTED]>
> I am using an XP Pro platform accessing an MSSQL 2000 server.  I use
> ActivePerl 5.8.4 to access my database via ODBC.  The latest versions
> of the DBI and DBD-ODBC modules are installed.  When I attempt to use
> placeholders in my script, NOTHING HAPPENS.  The script runs to
> completion with no errors, but no data is stored.  If I do the same
> thing with a MySQL database, it all works OK.  Am I missing something
> or what?  Does the MS SQL Server ODBC driver 3.8.5.1117 that my DSN
> uses actually support placeholder use?  It would appear that it does
> not, but does not complain either.  Below is a code snippet.  Thanks
> in advance for any help.  In the meantime, I have abandoned the
> placeholder concept with its inherent efficiency in loops, and now use
> a DBI do command instead.  It works, but...
> 
> ...
> 
> $dbh_MSSQL =
> DBI->connect($dsn_MSSQL,$username_MSSQL,$password_MSSQL,{RaiseError =>
> 0, PrintError => 0})
> 
>   or bail_out("   CANNOT connect to MSSQL database [$dsn_MSSQL]");
> 
> 
> $sth_MSSQL = $dbh_MSSQL->prepare(qq{INSERT INTO msag
> (pfx,streetName,rangeLow,rangeHigh,community,state,oddEven,esn,[911ID]
> ,[ date],telco,reserved,exchange,clli) VALUES
> (?,?,?,?,?,?,?,?,?,?,?,?,?,?)})
> 
>   or bail_out("   CANNOT prepare MSSQL statement for transactions");
> 
> $dbh_MSSQL->{RaiseError} = 1; # cause errors to raise exception

Try to change this to 

        $sth_MSSQL->{RaiseError} = 1;

>From perldoc DBI:

    Some attributes are inherited by child handles. That is, the 
value of an inherited attribute in a newly created statement handle 
is the same as the value in the parent database handle. Changes to 
attributes in the new statement handle do not affect the parent 
database handle and changes to the database handle do not affect 
existing statement handles, only future ones.

I do think the SQL is failing and you are ignoring the errors.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery

Reply via email to