- Phyllip Hall
- PowerServer 2020 or older (Obsolete)
- Friday, 12 July 2019 11:53 PM UTC
Does anyone know why I might be receiving the following error when commit; is executed in embedded SQL in WebServer?
The code connects to the database and retrieves data properly.
Primary Code
transaction l_trans
if -1 = this.trigger event ue_connect(l_trans) then return -1
dw_1.SetTransObject(l_trans)
dw_1.retrieve()
commit;
destroy l_trans
Event: ue_connect
string ls_error
string ls_datasource = 'test_postgres'
a_trans = create transaction
a_trans.AutoCommit = false
a_trans.DBMS = 'odb-pgs'
a_trans.DBParm = "CacheName='" + ls_datasource + "'"
// connect to db
CONNECT USING a_trans;
// --- Check for errors in database connection
if a_trans.SQLCode = 0 then
return 0
else
ls_error = 'Unable to connect to database:' + &
'~r~n' + '~r~n' + 'DBMS: ' + a_trans.dbms + &
'~r~n' + 'DBParm(DataSource): ' + a_trans.DBParm + &
'~r~n' + '~r~n' + 'Error Code: ' + string (a_trans.SQLDBCode) + &
'~r~n' + 'Error Message: ' + a_trans.SQLErrText
MessageBox('ue_connect', ls_error)
return -1
end if
Full Error Message:
Error 20010
Transaction is not connected.
For more help, please consult the Appeon user document.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.