* 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.
* 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.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 46 guests