rfc:pdonotices
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:pdonotices [2009/10/13 08:41] – created samuel.roze | rfc:pdonotices [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Databases notices ===== | ===== Databases notices ===== | ||
- | The most important Databases have a functionality which | + | The most important Databases have a functionality which returns some notices about the current query. These notices can be raised by the Database engine within a '' |
- | returns some notices about the current query. These | + | |
- | notices can be raised by the Database engine within a | + | |
- | '' | + | |
- | a user function. | + | |
- | Generally, notices contain information about the | + | Generally, notices contain information about the parallel executions, about the number of fetched rows or about the performances of the query. |
- | parallel executions, about the number of fetched rows or | + | |
- | about the performances of the query. | + | |
===== Get notices in PDO ===== | ===== Get notices in PDO ===== | ||
- | In PDO, notices are stored into a "'' | + | In PDO, notices are stored into a "'' |
- | the "'' | + | |
- | by each Database' | + | |
- | > '' | + | <code c> |
- | Where zval is the zval message string and val the | + | Where zval is the zval message string and val the allocated message string. |
- | allocated message string. | + | |
- | This is done if user have specified that he want to | + | This is done if user have specified that he want to fetch notices using the setAttribute or the $option parameter on the PDO constructor. |
- | fetch notices using the setAttribute or the $option | + | |
- | parameter on the PDO constructor. | + | |
- | * The name of the attribute is: '' | + | |
- | * The possible values are: | + | |
- | - PDO:: | + | |
- | - PDO:: | + | |
- | value is an array. | + | |
- | The name of the function that users have use to get | + | * The name of the attribute |
- | notices | + | * The possible values are: |
- | '' | + | * PDO::NOTICES_NONE -- no fetching |
- | '' | + | |
- | " | + | |
- | **Note:** '' | + | The name of the function that users have use to get notices is "'' |
- | function. | + | |
+ | **Note:** '' | ||
==== Get notices with PostgreSQL ==== | ==== Get notices with PostgreSQL ==== | ||
- | Notices in PostgreSQL are raised in Pl/PgSQL with the | + | Notices in PostgreSQL are raised in Pl/PgSQL with the "'' |
- | "'' | + | |
- | notice processor defined by the "'' | + | |
- | pointing on a "'' | + | |
- | the message into '' | + | |
- | described into the [[#get notices with postgresql|Get notices in PDO]] part. | + | |
==== Get notices in MySQL ==== | ==== Get notices in MySQL ==== | ||
- | In MySQL, the working of notices is NOT like PostgreSQL. | + | In MySQL, the working of notices is NOT like PostgreSQL. MySQL raise notices within simple queries like '' |
- | MySQL raise notices within simple queries like '' | + | |
- | '' | + | |
- | function. | + | |
- | In the MySQL C API, there' | + | In the MySQL C API, there' |
- | to get the number of warnings (and notices) for the last | + | query. This function is '' |
- | query. This function is '' | + | |
- | [http:// | + | |
- | If '' | + | If '' |
- | to 1, there are warnings and we will get them. To get | + | these warning, we have to fetch results of the "SHOW WARNINGS" |
- | these warning, we have to fetch results of the "SHOW | + | |
- | WARNINGS" | + | |
- | [http:// | + | |
- | If '' | + | If '' |
- | mysql_info which returns informations about the last | + | query. If the result of it is different to NULL, put the results into '' |
- | query. If the result of it is different to NULL, put the | + | |
- | results into '' | + | |
- | [http:// | + | |
==== Get notices in Oracle ==== | ==== Get notices in Oracle ==== | ||
- | In Oracle, notices can be raised by '' | + | In Oracle, notices can be raised by '' |
- | Pl/SQL function and some notifications are created by | + | |
- | the Oracle Server. | + | |
- | "Call '' | + | "Call '' |
- | that the application is interested in registering for | + | |
- | and receiving notifications. This starts a dedicated | + | |
- | listening thread for notifications on the client." | + | |
- | [http:// | + | |
- | Informations about notification callback which I didn't | + | Informations about notification callback which I didn't understand very much: http:// |
- | understand very much: http:// | + | |
This is about getting notifications from Oracle: http:// | This is about getting notifications from Oracle: http:// | ||
- | Global method for Oracle, in addition of these previous | + | Global method for Oracle, in addition of these previous methods, to get **DMBS_OUTPUT**: |
- | methods, to get **DMBS_OUTPUT**: | + | |
- | - Execute | + | * Execute |
- | - After each successful queries, fetch: | + | |
- | - Execute | + | |
==== For others Databases ==== | ==== For others Databases ==== | ||
- | For others Databases who have a notice functionality, | + | For others Databases who have a notice functionality, |
- | have to | + | |
reflect. Personally, i do not know which Databases... | reflect. Personally, i do not know which Databases... |
rfc/pdonotices.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1