Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote View Data Duplication
Message
From
10/12/2023 16:00:35
Kato Ba
Bytex Technologies Limited
Kaduna, Nigeria
 
 
To
10/12/2023 10:38:32
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01687405
Message ID:
01687413
Views:
32
>>Hi,
>>
>>For all I know, there is an SQL Update strategy named "Delete and Insert".
>>
>>Do the old records get deleted?
>>If no, is something stopping them to bet deleted, like a Trigger or whatever can block server side?
>>
>>I have not used Views for ages - and I recommend CursorAdapter instead of View - but at least the CA has something like UpdateStrategy. And since the CA somehow is mirrored in the DBSetProp, check this.
>>
>>Lutz
>>
>>Hi Lutz,
>>
>>I tried the SQL Update strategy named "Delete and Insert" and the old records don't get deleted. I also don't have any sort of trigger on the table. I am not able to wrap my head around what is happening.
>>
>>I have never used a CursorAdapter before. What do you think could be blocking the old records from being deleted?
>>
>>Alex
>
>Hi Alex.
>
>Just a side note: Please click to Hamburger menu top right of this window and check "Enable auto quote", it helps a lot reading.
>
>Test UpdateType via cursorgetprop after the view is used.
>
>I guess you do the obvious:
>- Use YourView
>- REPLACE something
>- TABLEUPDATE()
>?
>And you do not touch the cguid field.
>
>If you check GETFLDSTATE(-1) after the REPLACE, is there something indicating a new record?
>
>Again, try to set up a Cursoradapter. The good on it is, that it offers BEFORE* events, where you can stop and look at the commands that are send to the server. This is not possible with a view.
>
>The other thing I see is, try if you can protocol the commands on SQL Server side, possibly you see what is send to the server.
>
>So far I see nothing bad on your set up. My best guess is GETFLDSTATE and see what's going on server side.
>
>You say that the record is appended. Is cguid not marked as primary in the SQL Server?


Hi Lutz

>Just a side note: Please click to Hamburger menu top right of this window and check "Enable auto quote", it helps a lot reading.

Thank you so much for pointing me to this, never knew!

>If you check GETFLDSTATE(-1) after the REPLACE, is there something indicating a new record?

Yes, I got these value "344444444444444444" without the quotes
3 for the cGuid column and 4 for the rest of the other columns

>Again, try to set up a Cursoradapter. The good on it is, that it offers BEFORE* events, where you can stop and look at the commands that are send to the server. This is not possible with a view.

I will check this out in the coming days...

>The other thing I see is, try if you can protocol the commands on SQL Server side, possibly you see what is send to the server.

Several insert statements were sent to SQL Server. I confirmed this from SQL Server XEvent Profiler while running my application.

>You say that the record is appended. Is cguid not marked as primary in the SQL Server?

Yes, records are appended as against an update. cGuid is the primary key in SQL Server.

BTW, I inserted these records to the underlying remote view cursor as a result of some processing my application is performing. Could this be the reason why these records are duplicated? My understanding is that the records will be updated for those records whose primary key already exists, an insert will be done for those that don't and those records marked for deletion will be deleted when I issue TableUpdate.

Please, is this assertion correct?

TIA

Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform