AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Example: Synchronizing the replicas by using a filter procedure
HSynchronizeReplica (Example)
Example: Synchronizing the replicas by using a filter procedure
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)AjaxHFSQL ClassicHyper File 5.5 The following example uses a WLanguage procedure during the replication. This FilterReplica procedure is used to filter the records that must be taken into account during the replication and to manage the replication conflicts.
IF HSynchronizeReplica("C:\Data", "D:\Temp", rplToSubscriber, FilterReplica) = True THEN
	Info("Replication performed")
END
PROCEDURE FilterReplica()
ProgressBar(RPL.OperationNum, RPL.OperationMax)
// ******************************** Filter records ********************************
// Example: Exporting the catalog of bargains
IF RPL.Direction = rplToSubscriber AND RPL.Operation = rplHAdd THEN
	 IF RPL.File = "Product" AND {RPL.SourceAlias + ".BARGAINS"} = False THEN
		  // The record must not be copied
		  RETURN False
	END 
END
// ************************************** Conflict Management ***********************************
// Example: Checks whether the product already exists
// HReadSeek(PRODUCT, ProductCode, {RPL.SourceAlias + ".ProductCode"})
// IF HFound() THEN
// // The record must not be copied
// RETURN False
// END
// No problem was detected
RETURN True
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 15/11/2024

Señalar un error o enviar una sugerencia | Ayuda local