Home > Archive > SQL Anywhere Mobile > July 2005 > HOWTO: sql clean up in the remote after sync









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 HOWTO: sql clean up in the remote after sync
Ignacio Mateos

2005-07-21, 7:24 am

Hi:

I have a sql statement that I would like to execute in my remote database as
soon as the download process of the sync is finished.

I am thinking of writing it in SQL in end_download_table event or in the
end_download_connect
ion event.

My question is that the SQL I want to execute has to be in the remote not
the consolidated.

In fact it is this I want to execute:

delete from remote_access where time_ac = 1 and smartcard in
(select smartcard from remote_access where time_ac > 1); commit;

My doubt is, is this going to be executed in the remote database or in the
consolidated?

If this not in the remote, what way would I have to do this (I would like it
to be triggered and connected to the sync process, not some independent
process that happens after the sync).

Regards




Breck Carter [TeamSybase]

2005-07-21, 7:24 am

MobiLink scripts like end_download_table are always executed by
dbmlsrv9.exe on the consolidated database.

If you want something to be executed by dbmlsync.exe on the remote
database, consider one of the sp_hook_dbmlsync_* procedures. If you
create a procedure with one of the special sp_hook_dbmlsync_* names,
it will be automatically executed at a certain point; see the Help for
more details.

See sp_hook_dbmlsync_end
. Or, see sp_hook_dbmlsync_dow
nload_end, but
remove your commit.

Breck




On 21 Jul 2005 02:48:02 -0700, "Ignacio Mateos"
<imateos@telefonica.net> wrote:

>Hi:
>
>I have a sql statement that I would like to execute in my remote database as
>soon as the download process of the sync is finished.
>
>I am thinking of writing it in SQL in end_download_table event or in the
> end_download_connect
ion event.
>
>My question is that the SQL I want to execute has to be in the remote not
>the consolidated.
>
>In fact it is this I want to execute:
>
>delete from remote_access where time_ac = 1 and smartcard in
>(select smartcard from remote_access where time_ac > 1); commit;
>
>My doubt is, is this going to be executed in the remote database or in the
>consolidated?
>
>If this not in the remote, what way would I have to do this (I would like it
>to be triggered and connected to the sync process, not some independent
>process that happens after the sync).
>
>Regards
>
>
>


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Ignacio Mateos

2005-07-21, 1:24 pm

Thank you, I have tried and it seems to work, now my issue is deploying the
procedure to the remotes, ¿can I connect to the remote from Sybase Central?

Regards


"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> escribió en el
mensaje news:pf5vd1tqhd553u8
8ds1hn5nnna9jme715h@
4ax.com...
> MobiLink scripts like end_download_table are always executed by
> dbmlsrv9.exe on the consolidated database.
>
> If you want something to be executed by dbmlsync.exe on the remote
> database, consider one of the sp_hook_dbmlsync_* procedures. If you
> create a procedure with one of the special sp_hook_dbmlsync_* names,
> it will be automatically executed at a certain point; see the Help for
> more details.
>
> See sp_hook_dbmlsync_end
. Or, see sp_hook_dbmlsync_dow
nload_end, but
> remove your commit.
>
> Breck
>
>
>
>
> On 21 Jul 2005 02:48:02 -0700, "Ignacio Mateos"
> <imateos@telefonica.net> wrote:
>
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:
> http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com



Breck Carter [TeamSybase]

2005-07-21, 1:24 pm

On 21 Jul 2005 10:42:02 -0700, "Ignacio Mateos"
<imateos@telefonica.net> wrote:

>Thank you, I have tried and it seems to work, now my issue is deploying the
>procedure to the remotes, ¿can I connect to the remote from Sybase Central?


The short answer is "no".

If you have built a deployment mechanism using an
sp_hook_dbmlsync_sch
ema_upgrade procedure then you can use MobiLink to
deploy a new procedure.

The ASA plugin for Sybase Central can make a database connection to a
remote database if it can "see" the engine across the network; then
you could add the procedure. That may or may not be possible; it often
isn't in a MobiLink environment.

Breck

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Ignacio Mateos

2005-07-21, 1:24 pm

What I meant is if I could connect from Central so I could deploy the
procedure, not during the mobilink sync or anything like that.

I have been able to do so. (I hope there is nothing I did wrong that is
going to fail later...) but for now I was able to create the procedure,
synced, checked and yes all those records had disappeared.

Thank you so much for your help

"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> escribió en el
mensaje news:5hovd1512diiqrl
e2f5skp1dqvtdcid9nf@
4ax.com...
> On 21 Jul 2005 10:42:02 -0700, "Ignacio Mateos"
> <imateos@telefonica.net> wrote:
>
>
> The short answer is "no".
>
> If you have built a deployment mechanism using an
> sp_hook_dbmlsync_sch
ema_upgrade procedure then you can use MobiLink to
> deploy a new procedure.
>
> The ASA plugin for Sybase Central can make a database connection to a
> remote database if it can "see" the engine across the network; then
> you could add the procedure. That may or may not be possible; it often
> isn't in a MobiLink environment.
>
> Breck
>
> --
> SQL Anywhere Studio 9 Developer's Guide
> Buy the book:
> http://www.amazon.com/exec/obidos/A...7/risingroad-20
> bcarter@risingroad.com
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com



Breck Carter [TeamSybase]

2005-07-21, 1:24 pm

On 21 Jul 2005 11:10:12 -0700, "Ignacio Mateos"
<imateos@telefonica.net> wrote:

>What I meant is if I could connect from Central so I could deploy the
>procedure, not during the mobilink sync or anything like that.


Yes, if you *can* connect from Sybase Central, then you can certainly
add the procedure. All I meant to say is that remote databases are
often truly remote, across the internet and running dbeng9.exe so they
don't permit network database connections.

>I have been able to do so. (I hope there is nothing I did wrong that is
>going to fail later...) but for now I was able to create the procedure,
>synced, checked and yes all those records had disappeared.


It should be OK.

Breck

>
>Thank you so much for your help
>
>"Breck Carter [TeamSybase]" < NOSPAM__bcarter@risi
ngroad.com> escribió en el
>mensaje news:5hovd1512diiqrl
e2f5skp1dqvtdcid9nf@
4ax.com...
>


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com