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.

We are trying to adapt our sync model to be generic as each of our remote servers have a different name, i.e. STR0002, STR0003, STR0004, etc. We tried using @@servername, but it isn't working. If we enter the servername to connect to and update, we are going to have to have a separate model for each. Any ideas on what parameters to use??

asked 11 Jul '11, 11:09

Lisava's gravatar image

Lisava
16224
accept rate: 0%

By "remote server", what are you referring to?

  1. A remote database (SQL Anywhere or UltraLite)

  2. A MobiLink server (as indicated in your subject)

  3. The consolidated database

(I'm confused because @@servername looks like SQL, not a MobiLink server parameter...)

Note that synchronization model deployment creates batch files (.bat for Windows or .sh for non-Windows operating systems), and some of those take command-line arguments for connection parameters. Have a look at those in a text editor (eg. Notepad on Windows).

(11 Jul '11, 12:13) Graham Hurst

Ah! It's the remote database you want to identify so your download_cursor script can send the right data to it! That's very easy.

In your synchronization model, that's called a download subset. The model supports downloading by the user name that the remote database uses to connect to MobiLink, which is frequently used for what you want. Eg. when your remote database STR003 connects to the ML server, have it use STR003 as the ML user name, then your scripts (or those generated by the model) can use {ml s.username} which will be substituted by STR003 when STR003 is synchronizing.

For more info, see http://dcx.sybase.com/index.html#1101/en/mlstart_en11/mg-about-s-6040094.html

BTW, it's better to use the ML username or an authentication parameter (via Custom download subset in a sync model) than to use the remote database ID.

permanent link

answered 11 Jul '11, 17:31

Graham%20Hurst's gravatar image

Graham Hurst
2.7k11843
accept rate: 29%

THANK YOU!

(12 Jul '11, 05:38) Lisava

The MobiLink server can only connect to a single consolidated database at a given time. (See: mlsrv12 -c).

You will need to set up an individual MobiLink server for each database instance (ensuring that each MobiLink server is listening on a separate port and is named uniquely on the system), and then have dbmlsync/UltraLite clients connect to the appropriate TCP/HTTP MobiLink port that corresponds to the required consolidated database server.

permanent link

answered 11 Jul '11, 11:30

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

We have one consolidated DB and the sync model used to push down to store level (remote db) all have the same tables (data) being pushed, with the appropriate where clauses in the SQL to push data applicable to that user. Are you telling me we have to create a specific model for each user on the mobilink server? Previously we used SQL remote with publications and remote users (each remote user was a remote DB) So if I read your answer correctly, the config is done when setting up the server and not the model? Is that right. Also if you know what the parameters are or can point me to some documents to help, that would be great.

(11 Jul '11, 13:24) Lisava

Sorry - if I didn't mention before we use SQL Anywhere 11 - Also - we use @@servername extensively in our SQL, and I realise we cannot use it in Mobilink, but isn't there something which is equivilent to this then? That will pick up the servername on the remote db without having to specify a dsn name (as I mentioned previously, they are all differnt)

(11 Jul '11, 15:33) Lisava
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:

×371

question asked: 11 Jul '11, 11:09

question was seen: 2,284 times

last updated: 12 Jul '11, 14:44