SQLWIN - a free RDD for SQL
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hi Antonio!
I was devoting time to a SQLWin and made some changes that I would like to submit:
[From portuguese brazilian:]
Olá Antonio!
Estive dedicando algum tempo ao SQLWin e fiz algumas alterações que gostaria de lhe apresentar:
Download here: http://www.kssoftware.com.br/SQLWIN.ZIP
Aguardo comentários sobre as alterações propostas e espero contribuir de algum modo!
I was devoting time to a SQLWin and made some changes that I would like to submit:
Code: Select all
* Noted that it is necessary to allocate some default values for items of aWAData [] to avoid errors with NIL values such as a APPEND BLANK be called before a RecCount (). I adjusted it.
* Created in some drivers to control the possible SQL in use.
* GetFieldNames () / GetFieldEmptyValues () now receives an additional parameter to detect the type of driver in use and format the return correctly.
* New function SQLGetFullTableName () which returns the name of the table with his SCHEMA inside the database.
* Created the function SQLAdjustFn () which formats the file name passed as argument to a valid name in the database. Ideal for use in CREATE, USE, COPY, etc. ..
* GoBottom implementation
* Transaction Counter
* Introduced a flag for dbAppend (), InvalidBuffer and control of transactions.
* SQL_PUTVALUE () / SQL_GETVALUE () works with Buffer now.
* SQL_GOCOLD () implementation
* New function to build a SQL command (INSERT / UPDATE): SQL_WRITERECORD ()
* Support for LOGICAL / DATE fields in CREATE () / REPLACE
Comments on SQL_RECCOUNT ():
To compute the correct value of SQL_RECCOUNT () I suggest using the function
MAX () and not the value of COUNT () since we have 3 records with values
different:
Ex:
SQL_RECNO FIRST LAST AGE
************************************************** ***********************
1 HARBOUR PROJECT 9
2 XHARBOUR PROJECT 5
3 DBase VULCAN 28
4 CLIPPER SUMMER 23
************************************************** ***********************
Reccount: 4
After GOTO 3 / DELETE / PACK:
SQL_RECNO FIRST LAST AGE
************************************************** ***********************
1 HARBOUR PROJECT 9
2 XHARBOUR PROJECT 5
4 CLIPPER SUMMER 23
************************************************** ***********************
Reccount: 3
If we try to GOTO 3 the result is EOF ()... but i preferred not to amend this code.
Olá Antonio!
Estive dedicando algum tempo ao SQLWin e fiz algumas alterações que gostaria de lhe apresentar:
Code: Select all
* Notei que é necessário atribuir alguns valores padrões para os itens de aWAData[] para evitar erros com valores NIL como no caso de um APPEND BLANK ser chamado ANTES de um RecCount(). Eu ajustei isto.
* Criado algumas constantes para controlar os possíveis drivers SQL em uso.
* GetFieldNames()/GetFieldEmptyValues() agora recebe um parâmetro adicional para poder detectar o tipo de driver em uso e formatar o retorno corretamente.
* Nova função SQLGetFullTableName() que retorna o nome da tabela com o seu SCHEMA dentro do banco de dados.
* Criada a função SQLAdjustFn() que formata o nome do arquivo passado como argumento para um nome válido dentro do banco de dados. Ideal para ser usado em CREATE, USE, COPY, etc..
* GoBottom implementation
* Transaction counter
* Introduzido um flag para dbAppend(), InvalidBuffer & controle de transações.
* SQL_PUTVALUE() / SQL_GETVALUE() works with Buffer now.
* SQL_GOCOLD() implementation
* New function to build a SQL command (INSERT/UPDATE): SQL_WRITERECORD()
* Support for LOGICAL/DATE fields in CREATE() / REPLACE
Comentários sobre SQL_RECCOUNT():
Para computar o valor correto de SQL_RECCOUNT() eu sugeriria utilizar a função
MAX() e não o valor de COUNT() visto que podemos ter 3 registros com valores
diferentes:
Ex:
SQL_RECNO FIRST LAST AGE
*************************************************************************
1 HARBOUR PROJECT 9
2 XHARBOUR PROJECT 5
3 DBase VULCAN 28
4 CLIPPER SUMMER 23
*************************************************************************
Reccount: 4
After GOTO 3 / DELETE / PACK :
SQL_RECNO FIRST LAST AGE
*************************************************************************
1 HARBOUR PROJECT 9
2 XHARBOUR PROJECT 5
4 CLIPPER SUMMER 23
*************************************************************************
Reccount: 3
Se tentarmos um GOTO 3 pela lógica anterior resultaria em um EOF(), mas eu
preferi não alterar o código da função.
Aguardo comentários sobre as alterações propostas e espero contribuir de algum modo!
Vailton Renato
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Vailton,
Many thanks for your contributions to SQLWIN
In order to keep track of changes until we reach a workable version (to be uploaded to the harbour project SVN), we have arranged a page on our wiki, so we can visually find the differences from one version to the next one.
Here it is:
http://wiki.fivetechsoft.com/doku.php?i ... evelopment
I send you an email with your login and password to the wiki so you can update the wiki, and we can easily track the changes into its source code
p.s. Much nicer Avatar, thanks (though your personal photo would be much more appreciated by all of us)
Many thanks for your contributions to SQLWIN
In order to keep track of changes until we reach a workable version (to be uploaded to the harbour project SVN), we have arranged a page on our wiki, so we can visually find the differences from one version to the next one.
Here it is:
http://wiki.fivetechsoft.com/doku.php?i ... evelopment
I send you an email with your login and password to the wiki so you can update the wiki, and we can easily track the changes into its source code
p.s. Much nicer Avatar, thanks (though your personal photo would be much more appreciated by all of us)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Vailton,
Please upload your changes (the entire sqlwin.prg) to the wiki:
http://wiki.fivetechsoft.com/doku.php?i ... evelopment
so we can see your modifications in the source code. Thanks
You should have received an email with your login and password for the wiki.
Please upload your changes (the entire sqlwin.prg) to the wiki:
http://wiki.fivetechsoft.com/doku.php?i ... evelopment
so we can see your modifications in the source code. Thanks
You should have received an email with your login and password for the wiki.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
I have updated the code on page Antonio. As in my tests I split the main routines and routines to test the RDD in separate files, I took the liberty of creating another section in the Wiki for these routines.
I await comments,
PS: Excuse me for my bad English. I have done much use of Google Translate by these days.
I await comments,
PS: Excuse me for my bad English. I have done much use of Google Translate by these days.
Vailton Renato
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Vailton,
Ok, very good
Now we can easily see the new changes:
http://wiki.fivetechsoft.com/doku.php?i ... nt&do=diff
http://wiki.fivetechsoft.com/doku.php?d ... evelopment
Ok, very good
Now we can easily see the new changes:
http://wiki.fivetechsoft.com/doku.php?i ... nt&do=diff
http://wiki.fivetechsoft.com/doku.php?d ... evelopment