AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Example: Creating a view
  • Example: Creating a view with a condition on a Numeric variable
  • Example: Creating a view with a condition on a Character String variable
  • Example: Performing a search on a composite key in a view
HCreateView (Example)
Example: Creating a view
The following example is used to create a view and to read the records found in the view. These records are displayed in a trace window.
View1 is Data Source
// Create view
IF HCreateView(View1, Category, "*", "", "Caption>='B'", hViewAdd) = False THEN
Error(HErrorInfo())
END
// Browse view
HReadFirst(View1)
WHILE NOT HOut()
// Read the caption item of View1
Trace(View1.Caption)
HReadNext(View1)
END
HDeleteView(View1)
Example: Creating a view with a condition on a Numeric variable
The following example is used to create a view with a condition on a Numeric variable.
EXTERN MyView
// Create view
IF HCreateView("MyView", FileName, "*", "", ...
"ItemName =" + VariableName, hViewDefault) = False THEN
  Error(HErrorInfo())
END
// Browse view
HReadFirst(MyView)
WHILE NOT HOut()
  // Process to insert
    HReadNext(MyView)
END
Example: Creating a view with a condition on a Character String variable
Código de Usuario (UMC)HFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos The following example is used to create a view with a condition on a Character String variable.
EXTERN MyView
// Create view
IF NOT HCreateView("MyView", FileName, "*", "", ...
"ItemName =" + VariableName + "", hViewDefault)  THEN
Error(HErrorInfo())
END
 
// Browse view
HReadFirst(MyView)
WHILE NOT HOut()
    // Process to insert
    HReadNext(MyView)
END
Example: Performing a search on a composite key in a view
WINDEVCódigo de Usuario (UMC)HFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos The following example is used to create a view and to perform a search on a composite key found in the view.
// Create view
MyView is Data Source
HourGlass()
HCreateView(MyView, Cedex, "*", "", "", hViewDefault)
// Search
HReadSeekFirst(MyView, "CityZipCode", ...
HBuildKeyValue(Cedex, CityZipCode, "75000", "PARIS"))
HourGlass(False)
IF HFound() = True THEN
    Info("Record found")
    Trace(MyView.city + " " + MyView.ZipCode)
ELSE
    Info("Record not found")
END
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: 27/05/2022

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