|
| using sql vs HFSQLfunctions |
| Iniciado por guest, 27,jul. 2016 05:13 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 27,julio 2016 - 05:13 |
Hello Gang !!
using sql or HFSQLfunctions ?? for example: INSERTquery or Hadd ()
What is the difference ?? which to prefer ?? why ?? Thanks !!? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 27,julio 2016 - 10:08 |
Hello,
INSERT ! Use SQL language for accessing data from the database. With the 'Hread......'' functions you always get the whole record. So it causes a lot of data traffic that you don't need and wil give less performance.
Think about the future. If you want to migrate from HyperFile to another database (MSSQL,MYSQL) then you will have the benefits from using SQL |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 102 mensajes |
|
| Publicado el 27,julio 2016 - 10:34 |
In my opinion there is nothing to prefer, or to say it with Ted Cruz: 'Vote who you trust' 
Technically I think there is not a big difference. My guess is that at the beginning there was Hyperfile, an ordinary file based database format. Then the people from PC Soft added SQL capabilities. But still there are files for each table (aka data files in WD speaking).
Lets stay with your INSERT example. I think it's a lot more easy to do some hadd()
whatever.fieldA = a whatever.fieldB = b whatever.fieldC = c HAdd(whatever)
instead of
INSERT INTO whatever (fieldA,fieldB,fieldC) VALUES (a,b,c)
Additionally you have more control on everything with the H-functions. For example you can check if a file/table is locked before you HAdd(). Or you could check if the same data already exists.
When it comes to gather data I definitly prefer SQL. Especially when you have to collect data that is unique in a way.
For example, imagine some data like this:
... 20160721162505 T62_01 20160721162505 T62_01 20160721162505 T62_01 20160721162505 T62_01 20160721162505 T62_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 20160721185433 T63_01 ...
Now you have to find out the unique timestamps (left column) and check the amount of different values of the right column (t-numbers).
Without SQL you would probably choose a associative array without duplicates. But in SQL you just choose
SELECT t-NUMBER, COUNT(DISTINCT timestamp) FROM datatable GROUP BY t-NUMBER
The good thing about WinDev in this case is: you have a choice. Use whatever technique that fits the case and solves the problem. Ok, and that lets you (or someone else) understand the code sometimes in the future.
Sebastian
-- http://arnoldconsult.de WinDev 21 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL |
| |
| |
| | | |
|
| | | | |
| | |
|