NetTalk Central

Author Topic: NetWebService - what is p_web.MaybeRemoveDeletedRecords ?  (Read 2484 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
NetWebService - what is p_web.MaybeRemoveDeletedRecords ?
« on: April 17, 2018, 01:33:46 AM »
Hi,

I've just installed NT 10.19 and now the filters on the response from a VIEW don't work correctly. This the generated SQL sent to the database.

    SELECT A.GUID, ... FROM dbo.Session A WHERE (  A.GUID = '27RVOKQMGTQ52RRY' AND  A.DTS = 0 )  ORDER BY  A.TS

I can see the portion in the WHERE clause that comes from my own code (A.GUID = '27RVOKQMGTQ52RRY'). It's clear though that the second expression in the WHERE clause is the reason why no records are returned (A.DTS = 0). This extra clause is probably generated by the template, that results in the following line:

    p_web.MaybeRemoveDeletedRecords(loc:Filter,'SES:dts')

I think I understand why this is added, but to test for 0 instead of NULL in SQL is incorrect. The DTS value in SQL for a new record is NULL and not zero.

How can I alter the result from MaybeRemoveDeletedRecords to test for NULL?

Thys

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: NetWebService - what is p_web.MaybeRemoveDeletedRecords ?
« Reply #1 on: April 19, 2018, 10:05:52 PM »
Ideally your timestamp fields should default to 0, not null. Because null is a backend-dependant-construct, and the whole idea of the distributed data is to make it independent of the backend.

[Aside - I'd be interested in documenting the easiest way to do that if someone will tell me what it is...]

That said, I'll see if I can add an OR clause to that expression for SQL drivers.

cheers
Bruce