AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Characteristics of created data file
  • Additional files created
  • Password management
  • Managing fatal errors when creating a data file
  • Managing non-Latin character sets
  • Replication: Range of identifiers
  • Priority for defining the location of log files
  • Creating or opening an existing table
  • Managing indexes
  • Creating the data file from its description
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Performs the following operations:
  • If the data file does not exist, creates an empty data file (".FIC" extension) with the index file and the memo file if necessary.
    The function is equivalent to <Fuente>.Creation.
  • If the data file exists, opens the data file.
    In this case, the function is equivalent to <Fuente>.Open.
    To optimize the call to <Fuente>.CreationIfNotFound, the data file can be opened only when accessed for the first time (using the hDelayedOpening constant).
Remark: The automatic creation of non-existing data files can be enabled in the project description ("Files" tab of the project description, "Crear automáticamente los archivos de datos al abrirlos"). <Fuente>.CreationIfNotFound is automatically used if the data file does not exist when it is handled for the first time.
WINDEVWEBDEV - Código ServidorHFSQL Classic If the data file is logged, you can specify the location of the log files.
HFSQL Client/Server If integrity constraints have been defined and if they are supported, the links are updated by the server when creating the data file.
Ejemplo
// Création du fichier de données Commande (décrit dans l'analyse)
Client.CréationSiInexistant()
Sintaxis
<Result> = <Source>.CreationIfNotFound([<Password> [, <Path of the JNL file> [, <Path of the JournalOperation file>]] [, <Option>]])
<Result>: Booleano
  • True if the data file was created or opened,
  • False if a problem occurs. HError is used to identify the error. If a fatal error occurs, a specific process is required to continue the program and to check whether the data file was created (see the Notes).
<Source>: Tipo de fuente especificada
Name of data file to use.
iPhone/iPad The maximum number of files that can be simultaneously opened by an iPhone/iPad application cannot exceed 256. Therefore, up to 80 HFSQL files can be opened simultaneously (one ".fic" file, one ".ndx" file and one ".mmo" file for each HFSQL data file).
<Password>: Cadena de caracteres opcional
  • Password associated with the data file.
  • Empty string ("") if no password is used.
<Path of the JNL file>: Cadena de caracteres opcional
Access path to the JNL file associated with the logged data file. This parameter is only taken into account if the data file is logged. In this case, <File name>JNL.fic will be created at the specified location.
HFSQL Client/Server This parameter must not be specified. In HFSQL Client/Server, the path of JNL file is defined and it cannot be modified.
AndroidWidget Android iPhone/iPadPHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
<Path of the JournalOperation file>: Cadena de caracteres opcional
Access path to the JournalOperation file and to the JournalIdentification file associated with the logged data file. The JournalOperation file contains all the operations performed on the logged data file. This parameter is only taken into account if the data file is logged.
HFSQL Client/Server This parameter must not be specified. In HFSQL Client/Server, the path of operation file is defined and it cannot be modified.
AndroidWidget Android iPhone/iPadPHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
<Option>: Constante opcional
Optimize the opening of existing data files.
hChangeCharsetThe character set defined by ChangeCharset will be taken into account in the new data file. Sorts, searches or other types of operations performed on string keys (strings, characters, date and time) will use the new character set.
hDelayedOpeningIf the data file already exists, it will be opened during the first access to the data file. If the data file does not exist, it is created and opened.
HFSQL Classic This constant is only available for HFSQL Classic.
hNoLinkManagement of integrity: The links are not updated on the server (creation, modification or deletion).
Reminder: By default, the links are updated on the server when creating a data file.
HFSQL Client/Server This constant is only available for HFSQL Client/Server.

PHP This parameter is ignored.
Java Access by JDBC: This parameter is ignored.
AndroidWidget Android This parameter is ignored.
Observaciones
WINDEVWEBDEV - Código ServidorUniversal Windows 10 AppiPhone/iPadJavaAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos

Characteristics of created data file

The characteristics of created data file are as follows:
  • Name of the data file:
    Physical name defined during the file description in the data model editor. This name can be modified by <Fuente>.ChangeName before creating the data file.
  • Directory of data file:
    Directory defined during the file description in the data model editor. This directory can be changed with <Fuente>.ChangeDir and HSubstDir before creating the data file.
    Remark: If the UAC is enabled (Windows Vista and later), the data location is specific: the data will not be located in the application directory, but in a specific Windows directory. In this case, you must create the application data directory (you can get the path with fDataDirUser).
  • The order of items created in the physical file is the physical order of items created in the analysis (and not the logical order).
  • Content of the data file:
    The created data file is empty, which does not mean that its size is null (the file contains a header describing its structure).
Remark: If the data file already existed (same name, same directory), this data file is opened. If the hDelayedOpening constant is specified, the data file will only be opened the first time it is accessed (optimizes the speed of <Fuente>.CreationIfNotFound).
WINDEVWEBDEV - Código ServidorUniversal Windows 10 AppiPhone/iPadAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos

Additional files created

When creating a data file, the following files can be created in addition to the data file:
  • An index file (".NDX" extension) if one or more keys have been defined in the file description.
  • A memo file (".MMO" extension) if one or more memo items have been defined in the file description.
  • A log file (".JNL" extension). This file is created only if the corresponding option was selected during the file description (see next paragraph).
    Universal Windows 10 AppAndroidWidget Android iPhone/iPadPHP This file is not created.
  • A <ProjectName>.REP file. This file contains the list of data files handled by the application. This file is created (or filled) if the management of .REP is enabled (HSetREP). If the hDelayedOpening constant is specified, the .REP file will be updated during the automatic file opening performed during the first access to the data file. For more details, see .REP file.
    Universal Windows 10 AppiPhone/iPad This file is not created.

Password management

The password can be defined:
  • when the data file is created or opened by <Fuente>.CreationIfNotFound.
  • before the data file is created by <Fuente>.Password.Caution: The password is independent of data encryption. The data encryption must be configured during the file description in the data model editor ("Details" tab).
PHPConectores Nativos The password is not associated with a data file but with a database. This password must be specified during the connection (HConnect).

Managing fatal errors when creating a data file

If a fatal error occurs when creating a data file, it may be interesting to continue the program while checking whether the data file was created or not. To do so, we recommend that you perform the following exception process:
WHEN EXCEPTION IN
	Père.CréationSiInexistant()
DO
	Error("Erreur HFSQL: " + HError())
ELSE
	Trace("fichier créé")
END
WINDEVWEBDEV - Código ServidorUniversal Windows 10 AppiPhone/iPadAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos

Managing non-Latin character sets

If the hChangeCharset constant is specified, the character set used in the data file will be the one specified by ChangeCharset. Sorts, searches, ... on string keys (strings, characters, date and time) will be performed according to this character set.
The character set used can be modified by <Fuente>.Index.
Remark: the size of string items specified in the analysis is expressed in bytes and not in characters. Depending on the character set used, you may have to increase the item size (if the characters used are coded on 2 bytes for example).
WINDEVWEBDEV - Código ServidorAjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5

Replication: Range of identifiers

The automatic identifiers for the files of subscriber replicas are using a range of identifiers that differs from the one used by the file of master replica and by the other files of subscriber replicas.
This range of automatic identifiers is written in the header of each data file (".FIC" extension).
This range is initialized:
For more details, see the consequences of implementing the replication.
WINDEVWEBDEV - Código ServidorAjaxHFSQL ClassicHyper File 5.5

Priority for defining the location of log files

The location of log files is defined according to the following priority order:
  1. Location specified when creating the logged data file (<Fuente>.CreationIfNotFound).
  2. Location specified by <Fuente>.ChangeLogDir.
  3. Location specified in the analysis.
  4. Location of the logged data file.
If another application uses <Fuente>.DeclareExternal on a logged data file, the changes made by this application are saved in the log files specified in the header of the logged HFSQL data file.
HFSQL Client/Server The location of Log files is fixed and it cannot be modified. For more details, see Log files in Client/Server mode.
WINDEVWEBDEV - Código ServidorOLE DB

Creating or opening an existing table

If the table already exists, the table is opened.
If the table does not already exist, the table is created. When creating a table, WINDEV and WEBDEV try to create the items in the OLE DB type corresponding to the HFSQL type. If this type is not supported, the HFSQL engine successively tries all the "compatible" OLEDB types until it finds a type that is supported by the OLEDB database.
WINDEVWEBDEV - Código ServidorPHPConectores Nativos

Managing indexes

<Fuente>.CreationIfNotFound does not return any error messages if an index cannot be added. The table is created without the index that is causing the problem. In this case, duplicates may be found in an item defined as unique key by WINDEV or WEBDEV if the external database does not support the unique keys.

Creating the data file from its description

The data file can be directly created from its description in the data model editor. To do so, select "Create the data file" from the popup menu of the data file (in the analysis graph) and select the directory in which the data file must be created.
Componente: wd290hf.dll
Versión mínima requerida
  • Versión 25
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 20/06/2023

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