php - Capturing SQL notices from Propel ORM -
php - Capturing SQL notices from Propel ORM -
i have big sql function want execute on postgresql database via php/propel using prepared statement so:
$sql = "lots of sql statements"; $statement = $propelpdo->prepare($sql); $statement->execute();
in sql statements i'm trying execute, there many calls "raise info ..." , "raise warning ..." show debugging information. executing sql command line, can see notices helps debug sql:
psql -h hostname database username < lots_of_sql_statements.sql
my question: there way capture info , warning notices raised in sql php can log them later analysis? running sql on lot of different records , great able log notices instead of having go command line each individually see debugging info.
well if utilize actual propel objects can grab messages catching propelexception
try { $propelobject ->setsomething('foo') ->save() ; } grab (propelexception $pe) { someloggingfunction($pe->getmessage()); }
otherwise you're limited pdo error handling functions:
http://www.php.net/manual/en/pdo.error-handling.php
php sql postgresql propel
Comments
Post a Comment