in reply to Re^3: Dancer2::Plugin::Database and database errors
in thread Dancer2::Plugin::Database and database errors
This isn't pretty, and I don't really like it, but I found an answer, and so I can move forward with my project. Here it is:
my $dbh = database('current');
my $dbhstatus = ''; my $rows_deleted = $dbh->do( 'DELETE FROM states WHERE host_name = ? and service_description = +?', undef, ( $data->{'host_name'}, $data->{'service_description'} ) ) or $dbhstatus = 'delete error; [' . $dbh->errstr . ']';
So when things simply don't seem to be working using the module, I can now slip back to using the DBI processing. It's not ideal, in that the module itself is not reliable -- it is actually the quick_delete that is not working, not the quick_select, but you do what'cha gotta do...
If others have a better way of getting around this, then I'd love to know. I'm still convinced that there is a "clean and simple" way to get the database error code, but my testing simply did not get it.
David Lee Crites, Author and DevOps Dude
Devops: lee@critesclan.com
Author: davidlee@adoniah.co
quad alii ut vivere
|
|---|