Home > Archive > SQL Anywhere Mobile > October 2005 > sp_hook_dbmlsync_schema_upgrade









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 sp_hook_dbmlsync_schema_upgrade
Billy

2005-10-27, 8:20 am

Hi,

I am trying to alter table in remote database automatically.

I have tried to create such procedure in "begin_upload"
connection event using dotnet class. I just return a sql
"Create procedure sp_hook_dbmlsync_sch
ema_upgrade
Begin........ End " in such class.

However, it seems not working and even not creating the
procedure. (no error in log)

Can I create such procedure during synchronization?
Or it must be created together when remote database is made?
Same procedure works when I created it in remote manually.

Thanks a lot!

Billy

dbeng9 -v 9.0.2.3198
Shuchit

2005-10-27, 8:21 am

> dbeng9 -v 9.0.2.3198
>


>
> I am trying to alter table in remote database automatically.
>
> I have tried to create such procedure in "begin_upload"
> connection event using dotnet class. I just return a sql
> "Create procedure sp_hook_dbmlsync_sch
ema_upgrade
> Begin........ End " in such class.
>


The sp_hook_dbmlsync stored procedures are only ever used on the remote
database. They have nothing to do with the consolidated or the
upload/download events that you mention.


> Can I create such procedure during synchronization?
> Or it must be created together when remote database is made?
> Same procedure works when I created it in remote manually.
>


It has to be on the remote. Inside that stored procedure you could read
instructions from a table, etc to decide what schema changes need to happen.

Shuchit
Breck Carter [TeamSybase]

2005-10-27, 8:21 am

The sp_hook_dbmlsync_sch
ema_upgrade procedure is supposed to pre-exist
in the remote database, and contain your custom code to handle schema
changes that are downloaded via some kind of text/clob column.

You cannot create a procedure in any of the MobiLink scripts because
CREATE PROCEDURE implies COMMIT as a side-effect, and you must not do
your own commits as part of a synchronization; MobiLink must do that.

But never mind that... the begin_upload script runs on the
*consolidated* database, so that's where the procedure probably sits
now. The sp_hook procedures are supposed to go into the *remote*
databases.

Building a setup that uses sp_hook_dbmlsync_sch
ema_upgrade takes a bit
of work, especially if you want to be informed centrally of any errors
that occur on the remotes when you do alter table, etc. This newsgroup
has some discussions of the basic techniques.

Breck

On 12 Oct 2005 02:50:59 -0700, Billy wrote:

>Hi,
>
>I am trying to alter table in remote database automatically.
>
>I have tried to create such procedure in "begin_upload"
>connection event using dotnet class. I just return a sql
>"Create procedure sp_hook_dbmlsync_sch
ema_upgrade
>Begin........ End " in such class.
>
>However, it seems not working and even not creating the
>procedure. (no error in log)
>
>Can I create such procedure during synchronization?
>Or it must be created together when remote database is made?
>Same procedure works when I created it in remote manually.
>
>Thanks a lot!
>
>Billy
>
>dbeng9 -v 9.0.2.3198


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