According to the docs., CURRENT REMOTE USER returns the user ID of the remote user (only in case of SQL Remote). Is there a way to make use of this special value also on Mobilink Server? So that I can distinguish within some procedure whether the transaction is a local or is coming from a remote database (throug mobilink)? |
The MobiLink Server is just an ODBC application that can connect to any number of different consolidated databases (SQLA, Oracle, DB/2, MSS), so there is nothing built into the SQL Anywhere database engine to automatically detect whether it's the MobiLink Server connected. It's easy enough to do this yourself programmatically though. Option #1 : Add "con=ThisIsMobiLink" to the connection string that MobiLink uses to connect to the consolidated database. Your stored procedures can now use the name of connection to determine whether it's MobiLink. create procedure end_upload() begin if CONNECTION_PROPERTY('Name') = 'ThisIsMobiLink' then message 'in end_upload'; end if; end; Option #2 : Create and drop a connection level variable in the begin_synchronization and end_synchronization events and then use the VAREXISTS function to check for the existence of the connection level variable. Other may suggest other options, but those two are the easiest IMHO. Reg Thanks you!
(10 Sep '20, 12:25)
Baron
Or just use a particular user for ML connections that is not used by ordinary connections to the consolidated database. That method should work with any supported consolidated database..
(10 Sep '20, 12:47)
Volker Barth
|
Please confirm that your consolidated database is running on SQL Anywhere, not Oracle, etc.
yes, my cons. is an SQL Anywhere (V10)