The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

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