ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Modifies the current record if it exists, otherwise adds a new record.
Example
WIN_Customer.ToFile()
Customer.Save()
Syntax
<Result> = <Source>.Save([<Options>])
<Result>: Boolean
  • True if the addition or the modification was performed,
  • False if an error occurred.
<Source>: Type corresponding to the specified source
Name of the data file, view or query used.
<Options>: Optional integer constant
Used to configure:
  • the effect of addition or modification on the current iteration.
  • the mode for calculating the automatic identifier. For more details, see Managing the automatic identifier during an addition.
  • the lock mode of the added or modified record.
  • the management of duplicates.
  • the management of integrity.
Hyper File 5.5 This parameter is ignored.
hAffectBrowseEffect of the adidtion/modification on the iteration: The addition or the modification affects the iteration.
For example, <Source>.ReadNext used after <Source>.Save positions on the record found after the added/modified record.
The hAffectBrowse constant has priority over the hWriteDefault constant.
hCheckDuplicatesManagement mode of duplicates: Checks for duplicates for this operation, even if the duplicate check is disabled (<Source>.SetDuplicates).
A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hCheckIntegrityManagement mode of integrity: Checks the integrity of operation even if the automatic integrity check is disabled (<Connection variable>.SetIntegrity).
A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hForceIDAutoMode for calculating the automatic identifier: The automatic identifier is not calculated during the addition. The identifier corresponds to:
  • the value assigned to the item through programming (CUSTOMERID = 7 for example)
  • the default identifier value specified in the data model editor (if the data file was just opened, with no record read)
  • the identifier value found in memory (identifier value for the last record read in the data file).
Once the record is added, the next automatic identifier calculated by the HFSQL engine will be calculated while ignoring the value added by hForceIDAuto.
A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time.
hIgnoreDuplicatesManagement mode of duplicates: Does not check for duplicates for this action, even if the automatic duplicate check is enabled (<Source>.SetDuplicates).
A WLanguage error occurs if the hIgnoreDuplicates and hCheckDuplicates constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hIgnoreIntegrityManagement mode of integrity: Ignores the integrity check for this add operation, even if the automatic integrity check is enabled (<Connection variable>.SetIntegrity).
A WLanguage error occurs if the hIgnoreIntegrity and hCheckIntegrity constants are used at the same time.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockNo
(default value)
Mode for locking the added or modified record: No lock: the added or modified record will not be locked.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockReadWriteMode for locking the added or modified record: Lock in read/write mode: the added or modified record will be locked in read/write. This record cannot be read or modified by another application. Only the current application can modify it, read it or unlock it.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hLockWriteMode for locking the added or modified record: Lock in write mode: the added or modified record will be locked in write mode. This record can be read by another application but it cannot be modified by another application. Only the current application can modify it or unlock it.
AndroidAndroid Widget This constant is not available.
Java Access by JDBC: This constant is not available.
hRecalculateIDAutoMode for calculating the automatic identifier: The automatic record identifier will be recalculated during the write operation. This constant has priority over hForceIDAuto and hSetIDAuto.
hSetIDAutoMode for calculating the automatic identifier: The automatic identifier is not calculated during the addition: the identifier value will be the one stored during the addition.
The next identifier value calculated by the HFSQL engine will correspond to the greatest identifier value in the file +1.
A WLanguage error occurs if the hSetIDAuto and hForceIDAuto constants are used at the same time.
hWriteDefault
(default value)
Effect of the adidtion or modification on the iteration: The addition or the modification does not affect the current iteration.
For example, <Source>.ReadNext used after <Source>.Save positions on the record found after the current record before the addition or modification.
The hAffectBrowse constant has priority over the hWriteDefault constant.
Remarks
Business / UI classification: Business Logic
Component: wd290hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/22/2023

Send a report | Local help