EnglishУкраїнськаmRussian
Login/New
Topic with no new replies

Access to DB error query messages


Author Message
Written on: 16. 03. 2017 [21:10]
cvillegas
Claudio Villegas
Topic creator
registered since: 26.10.2016
Posts: 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
Written on: 17. 03. 2017 [07:45]
roman
Roman Savochenko
Moderator
Contributor
Developer
registered since: 12.12.2007
Posts: 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.



0672