Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

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)?

asked 10 Sep '20, 09:49

Baron's gravatar image

accept rate: 48%

Comment Text Removed

Please confirm that your consolidated database is running on SQL Anywhere, not Oracle, etc.

(10 Sep '20, 10:30) Breck Carter
Replies hidden

yes, my cons. is an SQL Anywhere (V10)

(10 Sep '20, 12:22) Baron

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()
  if CONNECTION_PROPERTY('Name') = 'ThisIsMobiLink' then
      message 'in end_upload';
  end if;    

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.


permanent link

answered 10 Sep '20, 10:19

Reg%20Domaratzki's gravatar image

Reg Domaratzki
accept rate: 36%

edited 10 Sep '20, 12:28

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

See also this similar question... with quite similar participants... :)

permanent link

answered 10 Sep '20, 15:14

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 10 Sep '20, 15:15

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: 10 Sep '20, 09:49

question was seen: 928 times

last updated: 10 Sep '20, 17:24