cancel
Showing results for 
Search instead for 
Did you mean: 

equivalent to CURRENT REMOTE USER in Mobilink

Baron
Participant
1,129

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

Accepted Solutions (1)

Accepted Solutions (1)

regdomaratzki
Product and Topic Expert
Product and Topic Expert

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

Baron
Participant
0 Kudos

Thanks you!

VolkerBarth
Contributor
0 Kudos

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..

Answers (1)

Answers (1)

VolkerBarth
Contributor

See also this similar question... with quite similar participants... 🙂