УкраїнськаEnglishmRussian
Вхід/Новий
У темі немає нових постів

Access to DB error query messages


Автор Повідомлення
Повідомлення створено: 16. 03. 2017 [21:10]
cvillegas
Claudio Villegas
Автор теми
Зареєстрован(а) с: 26.10.2016
Повідомлення: 14
I have implemented a scrip that generates alarms and stores them in a DB table.
For the interaction with the database I used the "dbReqSQL" function and everything perfect.

However, I can not find the way to read the message or error code when a SQL query is erroneous, it only returns the empty array.

Is there any way to get error messages from the DB after running "dbReqSQL"?

regards
Повідомлення створено: 17. 03. 2017 [07:45]
roman
Roman Savochenko
Moderator
Contributor
Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3750
"cvillegas" wrote:

I have implemented a scrip that generates alarms and stores them in a DB table.
For the interaction with the database I used the "dbReqSQL" function and everything perfect.

However, I can not find the way to read the message or error code when a SQL query is erroneous, it only returns the empty array.


See here!
Array SQLReq( string req, bool tr = EVAL_BOOL ); — Formation of the SQL-request to the DB, inside (tr=true), outside (tr=false) or no matter (tr=EVAL_BOOL) to transaction. At an error the result's property "err" sets to the error value.


Learn, learn and learn better than work, work and work.



2628