SQLWIN - a free RDD for SQL

User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

I want to finish on next Tuesday the routines of SEEK / INDEX.
Vailton Renato
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Antonio noticed that the queries used in these examples are formatted for MySQL, I correct?
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Vailton,

Yes, mostly.

Dear Vailton, please change that "red brain" avatar. It hurts :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Hi Antonio!

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.
[From portuguese brazilian:]
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.
Download here: http://www.kssoftware.com.br/SQLWIN.ZIP

Aguardo comentários sobre as alterações propostas e espero contribuir de algum modo!
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Ok I am waiting for the mail until it reached nothing.
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Vailton,

It has been sent to renato@sqllib.com.br

Should we use a different one ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Antonio, please send to vailtom@gmail.com!

Gracias.
:)
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Vailton,

Already sent :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Antonio,

I can simply paste the entire source code that changed on this Wiki page?

Sorry many questions, is that never before used a Wiki.
:oops:
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Vailton,

Yes. Paste it in between:

...
<code clipper>
...all sqlwin.prg code
</code>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

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.
:wink:
Vailton Renato
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vailtom
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm
Contact:

Post by vailtom »

Very interesting this ... Were you able to test changes? What think?
Vailton Renato
Post Reply