Home > Archive > SQL Anywhere Mobile > March 2005 > deletion from remote after upload









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 deletion from remote after upload
danny

2005-03-30, 9:42 am

I would like to delete records from the remote db after
upload successfully to consolidated, and don't want the
deletion to upload back to consolodated. How do I know the
remote upload successfully to consolidated db and where I
can put the deletion script ? Pls advise.
Shuchit

2005-03-30, 9:42 am

danny wrote in news:4222cd06.3582.1681692777@sybase.com:

d> I would like to delete records from the remote db after
d> upload successfully to consolidated, and don't want the
d> deletion to upload back to consolodated. How do I know the
d> remote upload successfully to consolidated db and where I
d> can put the deletion script ? Pls advise.

See the following topic in the help

MobiLink Clients
Adaptive Server Anywhere Clients
Temporarily stopping synchronization of deletes

You can also view this online at
<http://tinyurl.com/6g5ny>

which points to (mind the wrapped URL)
<http://www.ianywhere.com/developer/...e/0902/en/html/
dbmnen9/00000089.htm>


Shuchit
danny

2005-03-30, 9:42 am

Thanks for the refering page. Can I put this STOP/START
SYNCHRONIZATION DELETE under sp_hook_dbmlsync_upl
oad_end
stored procedure when upload success ?

> See the following topic in the help
>
> MobiLink Clients
> Adaptive Server Anywhere Clients
> Temporarily stopping synchronization of deletes
>
> You can also view this online at
> <http://tinyurl.com/6g5ny>
>
> which points to (mind the wrapped URL)
> <http://www.ianywhere.com/developer/..._manuals/sqlany
> where/0902/en/html/ dbmnen9/00000089.htm>
>
>
> Shuchit

Greg Fenton

2005-03-30, 9:42 am

danny wrote:
> Thanks for the refering page. Can I put this STOP/START
> SYNCHRONIZATION DELETE under sp_hook_dbmlsync_upl
oad_end
> stored procedure when upload success ?
>


I believe you can. But realize that this approach is only one of a few
possible solutions.

One problem with this approach is that you need to identify the
particular rows you need to delete. If you have something in your
schema to help you determine this, then START/STOP SYNCH DELETE is a
good way to go.

There are (at least) two other choices you have:

1. Have the consolidated send down the deletes using the
download_delete_curs
or. In this approach, you would record the PK of
the uploaded records (say in a temporary table) and then use that stored
info to download the rows to delete.

2. Have the consolidated truncate the entire table on download. If you
know that after a successful upload all of the rows in that table are to
be deleted, then simply use the download_delete_curs
or to send down a
"NULL row" (that is a single row with all NULL values), which is a
special instruction to the remote to truncate that table.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
sonson

2005-03-30, 9:42 am

To:all

When I use Null row to delete all row in the table. error
occurs during synchronization~

here is the log of server
I. 03/01 15:37:48. <1.5> [DE01]: download_delete_curs
or
orderdo (open for read):
SELECT NULL, NULL
I. 03/01 15:37:48. <1.5> [DE01]: Translated SQL:
SELECT NULL, NULL
E. 03/01 15:37:48. <1.5> [DE01]: Error: [-10002] ODBC:
[Microsoft][ODBC SQL Server Driver]Restricted data type
attribute violation (ODBC State = 07006, Native error code =
0, Column or parameter #2)
I. 03/01 15:37:48. <1.5> [DE01]: Error Context:

The table has 2 keys in first and second column~

Remote db - ASA 9.0.2.2551
Consolidation db - MS SQL2000
Pocket Builder 1.5.2 build 403

> danny wrote:
>
> I believe you can. But realize that this approach is only
> one of a few possible solutions.
>
> One problem with this approach is that you need to
> identify the particular rows you need to delete. If you
> have something in your schema to help you determine this,
> then START/STOP SYNCH DELETE is a good way to go.
>
> There are (at least) two other choices you have:
>
> 1. Have the consolidated send down the deletes using the
> download_delete_curs
or. In this approach, you would
> record the PK of the uploaded records (say in a temporary
> table) and then use that stored info to download the rows
> to delete.
>
> 2. Have the consolidated truncate the entire table on
> download. If you know that after a successful upload all
> of the rows in that table are to be deleted, then simply
> use the download_delete_curs
or to send down a "NULL row"
> (that is a single row with all NULL values), which is a
> special instruction to the remote to truncate that table.
>
> Hope this helps,
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/

David Fishburn

2005-03-30, 9:42 am

sonson wrote in news:42241e7c.432a.1681692777@sybase.com
of sybase.public.sqlanywhere.mobilink:

Run dbmlsrv9 -v+ -ot ml.txt and post the output.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

David Fishburn

2005-03-30, 9:42 am

sonson wrote in news:42241e7c.432a.1681692777@sybase.com
of sybase.public.sqlanywhere.mobilink:

s> Remote db - ASA 9.0.2.2551
s> Consolidation db - MS SQL2000
s> Pocket Builder 1.5.2 build 403

What version and build of MobiLink are you using?

What ODBC driver is the DSN you can connect through MobiLink using?

I googled for this error and found a previous posting that is very
similar.

If you provide the output from starting ML using -v+ -ot ml.txt we could
confirm.

Anyway, based on the datatypes of your primary keys, you can do
something like this. Please let us know if it solves the problem.

PH> CREATE TABLE dbo.t_udf (
PH> udfnumber varchar(10) NOT NULL,
PH> udfdatetime datetime NOT NULL,
....
PH> CONSTRAINT t_udf_x PRIMARY KEY (udfnumber, udfdatetime) ,
PH> CONSTRAINT fk_udf_crew FOREIGN KEY (crew ) REFERENCES dbo.t_crews
PH> ) ;
....
PH>> PH> Select Null, Null in the download_delete_curs
or generates the

You might want to try something like:
select null, cast( null as datetime)

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

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