The forum will be down for maintenance at some point between Friday, September 25, 2020 at 5pm PDT and Sunday, September 27, 2020 at 11:59 PDT. Downtime is unknown but will be minimized.

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, 09:49

Baron's gravatar image

Baron
1.2k4769110
accept rate: 28%

Comment Text Removed

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

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

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

(10 Sep, 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()
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

permanent link

answered 10 Sep, 10:19

Reg%20Domaratzki's gravatar image

Reg Domaratzki
6.8k339104
accept rate: 39%

edited 10 Sep, 12:28

Thanks you!

(10 Sep, 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, 12:47) Volker Barth

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

permanent link

answered 10 Sep, 15:14

Volker%20Barth's gravatar image

Volker Barth
36.7k343505761
accept rate: 34%

edited 10 Sep, 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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×353
×73

question asked: 10 Sep, 09:49

question was seen: 80 times

last updated: 10 Sep, 17:24