ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Attention : This is version 26 of this documentation page. This feature may have been changed or removed in a higher version.
Help / WLanguage / Managing databases / HFSQL functions / Compatible Hyper File functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HCreateView_55 (Function)
In french: HCréeVue_55
HFSQLAvailable only with this kind of connection
Warning
HCreateView_55 is equivalent to HCreateView available in WINDEV 5.5.
This function is kept for backward compatibility (this function will still be supported in the forthcoming version).
In version 8, HCreateView has evolved and it can now be used to give an explicit name to the view.
To benefit from these new features, use the new syntax of HCreateView.
The documentation available in WINDEV 5.5 is as follows.
Caution: No independent context can be created when a view is created by HCreateView_55 See Managing the Hyper File contexts in the windows and reports for more details.
 
Purpose
Create a view on a Hyper File file.
Syntax
  • Syntax 1: Creating a view on all the items found in a Hyper File file
    <ViewIdentifier>= HCreateView_55(<File_Name>)
    • <ViewIdentifier> is a long integer used to identify the view.
    • <FileName> is a character string that contains the name of the Hyper File file used by the view.
  • Syntax 2: Creating a view on a selection of items found in a Hyper File file
    <ViewIdentifier>= HCreateView_55(<File_Name>,<Items> [,<SortItem> [,<SelectionCondition> [,<CreationMode> ,<PageSize>]]]])
    • <ViewIdentifier> is a long integer used to identify the view.
    • <FileName> is a character string that contains the name of the Hyper File file used by the view.
    • <Items> is a string containing the list of items found in the view. The items are separated by a comma (", ").
    • <SortItem> is a character string containing:
      • the name of the initial sort item of the view. The sort order can be specified by prefixing the string by "+" or "-". By default, the sort is performed in ascending order ("+").
      • an integer representing the subscript of the sort item among the "virtual" items of the view.
    • <SelectionCondition> is a character string that contains the selection conditions of records. To specify no selection condition, all you have to do is use an empty string.
    • <CreationMode> is an integer corresponding to a combination of the following WLanguage constants:
      • hViewLocking locks the records that are read in the file
      • hViewPostponed runs the view later with HExecuteView
      • hViewExclusive optimizes the creation time of the view on a single computer
      • hViewAdd stores the content of the view for the next hExecuteView
      • hViewDistinct deletes the duplicates according to the sort key or to a record number
    • <PageSize> is an integer indicating the number of records per page for a remote view (for a remote access).
  • Syntax 3: Creating a view from two views with the same structure
    <ViewIdentifier>=HCreateView_55(<IdentifierViewA>, <IdentifierViewB>,<OperationType> ,<Item>)
    • <ViewIdentifier> is a long integer used to identify the result view.
    • <IdentifierViewA> is a long integer used to identify a view.
    • <IdentifierViewB> is a long integer used to identify a view.
    • <OperationType> is a WLanguage constant:
      • hViewUnion union of all the rows found in view A and view B
      • hViewUnionEx union of all the rows not common to view A and view B
      • hViewIntersection rows common to A and B
      • hViewSubtraction rows found in A - rows common with B
      • hViewJoin Join between 2 views (only case where the views can have a different structure)
    • <Item> is a string indicating the sort item, used to perform the operation between the views. It contains:
      • the name of the sort item of the view.
      • the subscript of the sort item among the "virtual" items of the view.
      The sort order can be specified by prefixing the string by "+" or "-". By default, the sort is performed in ascending order ("+").
Details
A Hyper File view can be compared with a "virtual" Hyper File file: the file is not physically stored on disk but it can be used as a "real" Hyper File file.
Creating a view is a read operation performed on the files. It can go along with a lock operation of the records read, if modifications must be performed on the records.
HCreateView_55 returns a long integer. It is the identifier of the view, equivalent to a file handle. hCreateView_55 returns 0 if an error occurs when the view is created.
Details of <VirtualItems>:
If no item from the main file is described, all the items of the main file are taken into account.
The comma is used to separate between two descriptions of the item.
<VirtualItems> must have the following format (this string is automatically built by the wizard for code input):
"<AnItem> , <AnItem> , ..."
Types of items not supported:
  • The "composite key" items cannot be used in a view.
  • The "array" items cannot be used
  • The items and the files with long names are supported.
Details of <SelectionConditions>:
A selection condition is using the following syntax:
"CustName>'Smith' and ZipCode=34 or ZipCode=32"
The following operators are supported:
Operator
Meaning
Application
<>DifferentValid for all types
>Greater thanValid for all types
>=Greater than or equal toValid for all types
<Less thanValid for all types
<=Less than or equal toValid for all types
=Strictly equal toValid for all types
~=Almost equal toValid for the string types (ignores the spaces on the right)
]ContainsValid for string types only
]=Starts withValid for string types only
A selection condition is an <Expression> string where expression has the following format:
<Factor> [<Or/And> <Expression>]
with <Factor>: <SimpleItem> <Operator><SimpleItem>
or <Not> <Factor>
or (<Expression>)
with <Operator>: One of the above-mentioned operators
with <SimpleItem>: <ItemName>
or <NumericConstant>
or <'StringConstant'>
Caution:
  1. <ItemName> must only contain letters, digits and underscore characters ("_"), otherwise double quotes must be used: <Item Name with other characters">
  2. If the string to test in the selection condition contains a quote, the quote must be replaced by \'
  3. The "constant" strings must be enclosed in simple quotes.
  4. Cannot be included in a selection condition:
    • The binary memos
    • The subscripted items and the "Array" items
Details of <CreationMode>:
The read mode is a combination of constants that allow you to describe how the view will be built. The authorized constants are as follows:
  • hViewLocking to lock the records read in the file
  • hViewPostponed to run the view later with HExecuteView
  • hViewExclusive to optimize the creation time of the view in single-user mode
  • hViewAdd stores the content of the view during the next call to HExecuteView
  • hViewDistinct to delete the duplicates according to the sort key or to a record number
Notes
Caution: If HCreateView_55 is used during a file browse to create a view on this same file, the browse may be altered. In this case, we recommend that you use HSavePosition and HRestorePosition.
  • Code that must not be used:
    HReadFirst(File, Key) // First record according to the key
    HCreateView_55(File, ...)
    HReadNext(File,Key) // Danger:
    // This is not necessarily the second record read according to the key
  • Recommended code:
    HReadFirst(File, Key) // First record according to the key
    Num = HSavePosition(File)
    HCreateView_55(File, ...)
    HRestorePosition(Num)
    HReadNext(File, Key)
The comparable types are:
  • all the numeric types among themselves (including the currencies)
  • all the character strings among themselves (asciiz, basic, pascal, text memos)
All items of main file can be part of the condition, even the ones that do not belong to the virtual items.
The condition is applied to each virtual record before it is included in the view. Therefore, you cannot specify several mutually excluding conditions for the same record (join). For example:
  • "Date='1997' and Date='1996'" returns no result
  • "Date>='1996' and Date<='1997' returns all the records found between 1996 and 1997.
The comparisons between strings are performed according to the ASCII value of the characters (and not according to the lexicographic value). Caution: 'a' > 'Z'
The numeric constants are real if they contain a decimal part (ex: 100.0)
The size of a view cannot exceed: 16MB - 64 KB (16MB minus 64 KB).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/26/2021

Send a report | Local help