Search notes:

SQL*Plus/Powershell: Color error messages when running a script

When running an SQL script with start or @ from a PowerShell command line, the following pipeline will color lines that start with ORA- in red:
PS P:\ath\to\script> sqlplus rene@ora19 @install.sql | foreach-object { $line = $_; if ($line -match '^ORA-'){$line = "$([char]27)[38;5;9m$line$([char]27)[0m"}; $line }

See also

PowerShell: Coloring the output of a command
PowerShell: ANSI colors

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758191750, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL-Plus/_misc/color-error-messages(40): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78