User bio
404 bio not found
Malaga, Spain
Member since Feb 21, 2018
Posts:
Replies:
Thanks Julian.
If there is any error in the query, always throw a generic error code (ERROR #6022: Gateway: Execute fail), but I don't know if it is due a a duplicate value (code 2061) or is due other sql error code.
Using this code, err.Code always is 6022
Note: I've done the following code to catch the native error... but it is a bit "smell code"
// run the query
Set tSC = ..Adapter.ExecuteUpdateParmArray(.nrows,SQL,.param)
// Check if there is any error
If $$$ISERR(tSC)
{
Set msgError = $System.Status.GetErrorText(tSC)
// Check here if the native error code is 2601 (Cannot insert duplicate key row into object 'MYPATIENTS' with unique index 'UQ_UNIQUE_INDEX')
if $FIND(msgError, "[2601]") > 0
{
// This is a insert/update that violates the unique code
// remove duplicate record
quit $$$OK
}
else
{
// Generic error... thow excepction
quit tSC
}
}
Open Exchange applications:
Certifications & Credly badges:
Global Masters badges:
Followers:
Following:
Thank you Luis Angel,
I've followed the steps of the documentation and now it works.
Fortunally, the code of that namespace it was a dummy code just to create a documentation about how to rename a namespace.