Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: UPDATE not working with MS SQL Server

by keszler (Priest)
on Nov 04, 2011 at 16:24 UTC ( [id://935972]=note: print w/replies, xml ) Need Help??


in reply to UPDATE not working with MS SQL Server

What does

my $sth = $dbh -> prepare("UPDATE vac_balance SET carry_over = ? WHERE + employee_id = ?") or die $dbh->errstr; $sth -> execute($carry_over, $employee_id) or die $dbh->errstr;
say?

Replies are listed 'Best First'.
Re^2: UPDATE not working with MS SQL Server
by Perobl (Beadle) on Nov 04, 2011 at 16:36 UTC

    I spotted my problem ... of course, after I posted here.

    The code shared in my post is clean. The problem is in my SQL schema. There was a field name mismatch.

    All is working fine now.

      It's good practice to use the die statement, especially with databases, as it probably would have informed you of a bad column name.

        Or set RaiseError, which would make it die automatically in case of error...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://935972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-25 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found