|
Home > Archive > SQL Anywhere Mobile > June 2005 > Mobilink Syncronization Question!
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Mobilink Syncronization Question!
|
|
| Dimitris Karistinos 2005-06-14, 7:24 am |
| Hello group,
I am looking into the different types of synchronization using mobilink. As
for the timestamp thinks are pretty much clear.
My question has to do with synchronization when I know the subset of data
that I need and in most cases this is defind by a parameter like id or name
or something else.
I have some tables that I know at any point of time the data that I want to
download to the remote database. So is it possible to define in a script
something like:
select id, name
where colname >"value"
As for the value I want to get it dynamically each time by the user that
synchronizes. I repeat hte value can be something like a name or id or
amount etc regarding the table.
I will wait for your comments.
Kind regards
D.
| |
| Liam Cavanagh 2005-06-14, 9:24 am |
| Hi Dimitris,
One way you could accomplish this is through the use of authentication
parameters. Although typically the authentication parameters are of course
meant to be used for user authentication purposes. You could use them to
pass up custom user values.
For example: dbmlsync -ap "parmVal1"
You can actually pass up multiple parameters if you like.
There is a sample that uses Authentication Parameters on CodeXchange:
http://ianywhere.codexchange.sybase.com/
The other alternative that I see is to create a table called UserParms. In
this table the remote user adds a new row with the value of the parameter
that they want to pass to the server. Then when it is synchronized up to
the server you could do a join to this table to get the value for your
parameter.
--
Liam Cavanagh
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Product Management
"Dimitris Karistinos" <dkaris@relational.gr> wrote in message
news:42aed1ab@forums
-1-dub...
> Hello group,
> I am looking into the different types of synchronization using mobilink.
> As for the timestamp thinks are pretty much clear.
> My question has to do with synchronization when I know the subset of data
> that I need and in most cases this is defind by a parameter like id or
> name or something else.
>
> I have some tables that I know at any point of time the data that I want
> to download to the remote database. So is it possible to define in a
> script something like:
>
> select id, name
> where colname >"value"
>
> As for the value I want to get it dynamically each time by the user that
> synchronizes. I repeat hte value can be something like a name or id or
> amount etc regarding the table.
>
> I will wait for your comments.
> Kind regards
> D.
>
| |
| Dimitris Karistinos 2005-06-14, 9:24 am |
| Hello Liam
Thank you for your prompt response. So for dynamic supplied values there is
no easy way.....!
I at each point of time I have a specific set of data can I use a script
like
select * from table
where colname=valus
and all the values are known?
Regards
Dimtiris Karistinos
PS: What I am trying to do in general is to find out how can I change
dynamically the where clause in order to take only specific sets of data
from each table
"Liam Cavanagh" <Liam. CavanaghNO@SPAMianyw
here.com> wrote in message
news:42aed6be$1@foru
ms-1-dub...
> Hi Dimitris,
>
> One way you could accomplish this is through the use of authentication
> parameters. Although typically the authentication parameters are of
> course meant to be used for user authentication purposes. You could use
> them to pass up custom user values.
>
> For example: dbmlsync -ap "parmVal1"
>
> You can actually pass up multiple parameters if you like.
>
> There is a sample that uses Authentication Parameters on CodeXchange:
> http://ianywhere.codexchange.sybase.com/
>
> The other alternative that I see is to create a table called UserParms.
> In this table the remote user adds a new row with the value of the
> parameter that they want to pass to the server. Then when it is
> synchronized up to the server you could do a join to this table to get the
> value for your parameter.
>
> --
> Liam Cavanagh
> Certified ASA Developer Version 8
> iAnywhere Solutions - Sybase
> Product Management
>
> "Dimitris Karistinos" <dkaris@relational.gr> wrote in message
> news:42aed1ab@forums
-1-dub...
>
>
| |
| Greg Fenton 2005-06-14, 9:24 am |
| Dimitris Karistinos wrote:
>
> PS: What I am trying to do in general is to find out how can I change
> dynamically the where clause in order to take only specific sets of data
> from each table
Hmmm, well Liam has pointed out the two main techniques that we use for
this type of things: auth parameters or a "user params" table. For the
user params table, we typically grab the value at the end of the upload
or at the begin_download, put it into a database variable, and then use
that database variable in the WHERE clause:
WHERE some_column = @my_uploaded_value
Now one thing I'd be interested to know more about is the particulars of
this "dynamic download". If you are dynamically downloading rows to the
remote, does your application not care about tracking what the remote
already has?
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
| Reg Domaratzki 2005-06-14, 8:26 pm |
| There are two parameters passed into the download cursor that you can use to
determine what data is downloaded. The two parameters are the last time the
user downloaded and the name of the user synchronizing. If the list of
values is something you'll maintain at the central site, they can be stored
in a table.
create table ValueList (
ml_user varchar(128),
val integer,
primary key (ml_user, val)
);
Now, you're download cursor looks something like :
select pkey, c1, c2, c3 from table
where last_modified >= ?
and colname in ( select val from ValueList where ml_user = ? )
--
Reg Domaratzki, Sybase iAnywhere Solutions
Certified SQL Anywhere Associate
Please reply only to the newsgroup
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL and click "GO"
"Dimitris Karistinos" <dkaris@relational.gr> wrote in message
news:42aedae5@forums
-1-dub...
> Hello Liam
> Thank you for your prompt response. So for dynamic supplied values there
is
> no easy way.....!
>
> I at each point of time I have a specific set of data can I use a script
> like
> select * from table
> where colname=valus
>
> and all the values are known?
>
> Regards
> Dimtiris Karistinos
>
> PS: What I am trying to do in general is to find out how can I change
> dynamically the where clause in order to take only specific sets of data
> from each table
>
> "Liam Cavanagh" <Liam. CavanaghNO@SPAMianyw
here.com> wrote in message
> news:42aed6be$1@foru
ms-1-dub...
the[color=darkred]
mobilink.[color=darkred]
data[color=darkred]
want[color=darkred]
that[color=darkred]
>
>
| |
| Shuchit 2005-06-15, 3:25 am |
| "Dimitris Karistinos" <dkaris@relational.gr> wrote in
news:42aedae5@forums
-1-dub:
> Hello Liam
> Thank you for your prompt response. So for dynamic supplied values there
> is no easy way.....!
>
You do realize that you call a stored procedure instead of just using a
select statement (depending on what RDBMS your consolidated is). You could
also populate temp. tables in the download_begin_rows table level event and
in your download_cursor just select from the temp. tables.
Shuchit
| |
| Dimitris Karistinos 2005-06-15, 3:25 am |
| Thank you all for your responses....
I think that they are very helpfull.....
It is my first project regarding mobilink and I want it to be good.... So I
need all they ways I can use in order to get my data avoiding the snapsots!
I think I am in agood way
Regards
Dimitris Karistinos
"Shuchit" <me@privacy.net> wrote in message
news:Xns9675D2FC7250
Dsvelkarprivacynet@1
27.0.0.1...
> "Dimitris Karistinos" <dkaris@relational.gr> wrote in
> news:42aedae5@forums
-1-dub:
>
>
> You do realize that you call a stored procedure instead of just using a
> select statement (depending on what RDBMS your consolidated is). You could
> also populate temp. tables in the download_begin_rows table level event
> and
> in your download_cursor just select from the temp. tables.
>
> Shuchit
|
|
|
|
|