ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example: Merging views
HMergeView (Example)
Example: Merging views
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses) Two views are created to select players from 2 different clubs. These views are merged into a final view that will be browsed.
EXTERN MyView1, MyView2, MyView_Finale
// Create the view named "MyView1"
IF HCreateView("MyView1", Club_Liverpool, "Player_Name", ...
"", "Player_Name > '" + Variable1 + "'", hViewDefault) = False THEN
Error(HErrorInfo())
END
 
// Create the view named "MyView2"
IF HCreateView("MyView2", Club_Chelsea, "Player_Name", "", ...
"Player_Name > '" + Variable2 + "'", hViewDefault) = False THEN
Error(HErrorInfo())
END
 
// Merge the 2 views into the final view named "MyView_Final"
IF HMergeView("MyView_Final", "MyView1", "MyView2", ...
hViewUnion, "Player_Name", "Player_Name" = False THEN
Error(HErrorInfo())
END
 
// Browse view
HReadFirst("MyView_Final")
WHILE HOut() = False
// Process to perform
HReadNext("MyView_Final")
END
 
// Destroy the views
HDeleteView(MyView1)
HDeleteView(MyView2)
HDeleteView(MyView_Final)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help