cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update remote database table with local data

0 Likes
2,802

I am trying to compare and update, insert, or delete to a remote MSSQL database. Connected MSSQL database to SQL Anywhere with remote server, and added a proxy table. Successfully inserted data from local table to remote proxy table with following query:

   INSERT INTO Test
      (ID,Name)
      SELECT SOURCE.accno, SOURCE.particulars
      FROM   "DBA"."acc_ledgers" SOURCE WITH 
      WHERE  NOT EXISTS (
                           SELECT  *
                           FROM    Test TARGET
                           WHERE   TARGET.ID = SOURCE.accno
                         );
    COMMIT

I tried the same with update but it's showing error as :

Updated operation attempted on non-updatable remote query

My update query is:

UPDATE Test
SET A.Name = B.particulars
FROM Test as A,"DBA"."acc_ledgers" as B WHERE A.ID = B.accno

how to achieve this?. I am trying this for a long time, but didn't get any solution. Please help.. Thank you.

View Entire Topic
regdomaratzki
Product and Topic Expert
Product and Topic Expert

This is a task best suited for MobiLink, not proxy tables. Please see the comments on your initial question for further help in using MobiLink.

0 Likes

I checked that before, but I cannot get a clear picture. I didn't understand how to connect mssql DB in that. Please help me. I need this solution so much. Thank you

regdomaratzki
Product and Topic Expert
Product and Topic Expert

I'm not sure how else I can help. The forum, or any community for that matter, is great for asking a specific question and getting an answer, but comments along the lines of "cannot get a clear picture" will typically get answered with links to the documentation, which is what I will do again.

I would again suggest reading the "MobiLink - Getting Started" documentation, in particular the section entitled "MobiLink Synchronization".

https://help.sap.com/docs/SAP_SQL_Anywhere/a09ffd5a93ff477cbcf9d9b1aa4d0801/9462b226f4ae48d1a62b16f5...

While we don't have a tutorial specific to using MS SQL Server, I do believe that following the "Tutorial: Introducing MobiLink" tutorial, which sets up synchronization between two SQL Anywhere database will also help give you a solid understanding of the technology.

https://help.sap.com/docs/SAP_SQL_Anywhere/a09ffd5a93ff477cbcf9d9b1aa4d0801/81b92a486ce21014b57cd24c...

I will again suggest that on the machine where you have SQL Anywhere installed, you follow the "Tutorial: Introducing MobiLink" tutorial to setup synchronization between two SQL Anywhere databases. If you run into trouble during the tutorial, ask a specific question about the specific problem you are having in the tutorial, and it will almost certainly be answered.

Reg