We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


How to abort execution of series of statements on error when using ODBC (PHP PDO) — Vertica Forum

How to abort execution of series of statements on error when using ODBC (PHP PDO)

brochabrocha Vertica Customer

Hello,
I am running a number of statements inside a single ODBC command and I would like the processing to abort if an error is encountered.
I saw posts about how to do this in vsql
https://forum.vertica.com/discussion/239932/exiting-a-vsql-script-following-an-error
and in DBVisualizer
https://forum.vertica.com/discussion/239934/exiting-a-dbvisualizer-script-following-an-error
But not for my case
I am using PHP PDO which wraps ODBC and this is how I connect:
$this->pdo = new PDO('odbc:' . $dsn, $QDb->User, $QDb->Password, array(
PDO::ATTR_EMULATE_PREPARES=>false,
PDO::MYSQL_ATTR_DIRECT_QUERY=>false,
PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION
));
Thanks,
Brocha

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file