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
  • Characteristics of created data file
  • Additional files created
  • Managing passwords
  • 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 an existing table
  • Constraints for referential integrity
  • OLE DB Oracle: Create a table containing a binary memo
  • OLE DB: Creation of a table containing automation identifiers
  • Managing indexes
  • Create a data file from its description in the data model editor
  • DATE and TIME items with the Native SQL Server Connector
  • HCreation and Native SQLite Connector
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Creates an empty data file (extension ".FIC") with index file, full-text index file, spatial index file and memo file if required.
This function can also be used to delete all records from a data file. In this case, the record in memory is not canceled. To initialize it, use HReset.
Note You can activate the automatic creation of non-existent data files in the project description ("Data files" tab in the project description, option "Crear automáticamente los archivos de datos al abrirlos"). HCreation 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 on the server.
// Create the Orders data file (described in the analysis)
HCreation(Orders)
Sintaxis
<Result> = HCreation(<Data file> [, <Password> [, <Path of the JNL file> [, <Path of the JournalOperation file> [, <Options>]]]])
<Result>: Boolean
  • True if the data file was created,
  • 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).
<Data file>: Character string
Name of data file to create.
Conectores Nativos MySQL: The table name must not contain accents. This is a problem specific to MySQL (tested on versions 3.23.52-max-nt and 3.23.47-max-nt of the MySQL server).
<Password>: Optional string or Secret string
  • Password associated with the data file.
    HFSQL ClassicHFSQL Client/Server HFSQL data file password is case insensitive.
  • Empty string ("") if no password is used.
    Novedad versión 2025
    Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI o Unicode string".
    Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
<Path of the JNL file>: Optional character string
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 through JDBC: This parameter is ignored.
<Path of the JournalOperation file>: Optional character string
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 through JDBC: This parameter is ignored.
<Options>: Optional Integer constant
Options for creating the data file:
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.
hNoLinkIntegrity management: links are not updated on the server (creation, modification, deletion as the case may be).
Reminder: by default, when a data file is created, links are updated on the server.
HFSQL Client/Server This constant is only available for HFSQL Client/Server.

PHP This parameter is ignored.
Java Access through JDBC: This parameter is ignored.
AndroidWidget Android This parameter is ignored.
Observaciones
WINDEVWEBDEV - Código ServidoriPhone/iPadJavaAjaxHFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5OLE DBConectores Nativos

Characteristics of created data file

The characteristics of created data file are as follows:
  • Data file name:
    Physical name defined during the file description in the data model editor. This name can be modified by HChangeName 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 HChangeDir and HSubstDir before creating the data file.
  • Content of 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).
  • The order of items created in the physical file is the physical order of items created in the analysis (and not the logical order).
If the data file already existed If the data file already existed (same name, same directory), this data file is recreated: the data file no longer contains any records. The index file and the memo file (if they exist) are also recreated. In this case, the integrity constraints are not checked.
Caution: The data file can only be re-created if it is not being used by another application.. If a file currently used must be cleared, use HDelete during a browse. You can also use HDeleteAll to delete all records from a data file.
WINDEVWEBDEV - Código ServidoriPhone/iPadAjaxHFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5

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 full-text index file (extension ".FTX") if one or more "Full-text index" keys have been defined in the data file description.
  • A spatial index file (extension ".SDX") if one or more "Spatial Key" keys have been defined in the data 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.
    AndroidWidget 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). For more details, see .REP file.
    iPhone/iPad This file is not created.

Managing passwords

  • The password can be defined:
    • when the data file is created by HCreation.
    • before the data file is created by HPass.
  • If the data file existed and if it was password protected, the data file is recreated, even if the password changes or does not exist anymore.
Attention Password is independent of data encryption. Data encryption must be configured when describing the data file 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
	HCreation(PARENT)
DO
	Error("HFSQL error: " + HError())
ELSE
	Trace("The file is created")
END
WINDEVWEBDEV - Código ServidoriPhone/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 or other types of operations performed on string keys (strings, characters, date and time) will use the new character set.
The character set used can be modified by HIndex.
Note The size of string fields specified in the analysis is in bytes, not 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:
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 (HCreation).
  2. Location specified by HChangeLogDir.
  3. Location specified in the analysis.
  4. Location of the logged data file.
If another application uses HDeclareExternal 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.
OLE DB

Creating an existing table

If the table already exists, HCreation tries to delete and recreate the table.
For example: Using an Oracle database
  • with OLE DB provider "MSDAORA": no new table can be created. If the table already exists, the records are erased.
  • with the OLE DB provider "oraOLEDB.Oracle": a new table can be created, and an existing table re-created. However, no index or memo item can be 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, WINDEV and WEBDEV successively try all the "compatible" OLE DB types until they find a type supported by the OLE DB database.
OLE DB

Constraints for referential integrity

When creating a table, the referential integrity constraints described in the analysis are not created on the database.
OLE DB

OLE DB Oracle: Create a table containing a binary memo

Warning: creating an Oracle table containing binary memos fails under Oracle 7.x (as LOBs are not supported in this version of Oracle).
OLE DB

OLE DB: Creation of a table containing automation identifiers

The automatic identifier will be created in the table only if the OLE DB provider supports the automatic identifiers.
Conectores Nativos

Managing indexes

HCreation 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 and WEBDEV if the external database does not support the unique keys.

Create a data file from its description in the data model editor

The data file can be directly created from its description in the data model editor. To do so, select "Create the data file" and select the directory where the data file must be created.
Conectores Nativos

DATE and TIME items with the Native SQL Server Connector

When using HCreation, the Native SQLServer Connector creates DATE and TIME items if the server version and the client library version correspond to SQL Server 2008 (or later).
Conectores Nativos

HCreation and Native SQLite Connector

The function HCreation FUNCTION function may fail ("database table is locked" error) if the following conditions are met:
  • the file to create already exists.
  • an iteration is in progress on another file in the same database.
This is caused by a limitation of SQLite database.
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 16/05/2025

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