Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

According to the docs, CURRENT REMOTE USER is used only in SQLREMOTE.

Doesn't this work in MOBILINK too (at least by DBMLSYNC)?

Is there any other alternative for DBMLSRV too?

Sorry, I couldnt have time to try it, and just wanted to have a quick answer from the Gurus!

asked 12 Mar '20, 12:12

Baron's gravatar image

accept rate: 48%

CURRENT REMOTE USER is specific to SQL Remote only.

In the ML Server, you can use the {ml s.remote_id} or {ml s.username} system parameter in your synchronization scripts.

Doc Links :

For dbmlsync, you have access to the MobiLink User that is synchronizing in many of the Event hooks for SQL Anywhere clients.


permanent link

answered 12 Mar '20, 12:56

Reg%20Domaratzki's gravatar image

Reg Domaratzki
accept rate: 37%


Additionally, you may use a particular database user when connecting via mlsrv to the consolidated to distinguish that from regular connections to the consolidated. This will do if you just have to distinguish remote and local modifications, it obviously won't do if you need to distinguish between modifications by different remote databases. In my experience the CURRENT REMOTE USER is used for both cases in SQL Remote environments...

(12 Mar '20, 17:31) Volker Barth
Replies hidden

If we are talking only of SQLRemote, then CURRENT REMOTE USER is useful (not replacable) only on the Cons. (becuase it can tell me whether the transaction is local or remote, and additionaly, it tells me from which specific Remote is this transaction coming).

On the Remote side, (if I assign a particular user for DBREMOTE), then I am able to distinguish whether the current transaction is local or is received via DBREMOTE (i.e. from the Cons. DB), (so assigning a user for DBREMOTE can replace the job of CURRENT REMOTE USER)!

In my understanding I can have only one Cons. in SQL-Remote installation! Am I right?

Also in Mobilink installation, I can have only one single Cons. (i.e. only one Mobilink server to each Mobilink Client)! Am I right?

(13 Mar '20, 05:10) Baron

As to the only one consolidated database, yes, that's generally true for each remote. However, there are environments with more than two levels/tiers, so a SQL Remote condolidated can itself be a remote for a higher level consolidated. But even then each single remote has just one (direct) consolidated.

We have also used CURRENT REMOTE USER on the remote to distinguish between local and remote operations (the latter of course then coming from the consolidated) - in my experience it was often enough to use something like "IF CURRENT REMOTE USER IS [NOT] NULL" within trigger code, and for that it only matters whether operations come from a remote or not, not from which remote. Therefore my suggestion that within ML, you simply may use a different userid for the ML server connection if that is enough.

(13 Mar '20, 07:24) Volker Barth

OK, thank you very much.

We already have several (multi tier) installations with Mobilink and also with SQLRemote.

Everything is clear!

Have a nice (and healthy) weekend!

(13 Mar '20, 08:11) Baron
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Mar '20, 12:12

question was seen: 796 times

last updated: 13 Mar '20, 08:11