Jump to content
Fivewin Brasil

Como adicionar um campo a uma tabela?


sambomb

Recommended Posts

Eu acho que AddField é somente para SQL, mas nao tenho certeza.

Achei algumas funcoes, vou listar o release abaixo, porem nenhuma melhorou a performance:

/* For more details on the translation logic please refer to the code,

as the space enough doesn’t allow for a detailed description of

every translation.

*/

* source/rdd/dbstrux.prg

! Fixed __dbCopyXStruct() to support all valid file names (by using a valid ALIAS)

+ Added:

dbModifyStructure( ) -> lSuccess

This is a high level function utilizing Brose() to allow user to modify or add field definitions.

The function will then import all data from the original file into the new definitions.

Data types changes will not cause any errors, and data will be converted as appropriate.

dbImport( ) -> lSuccess

This function will import all data from the source file into the empty file in current work area.

The function will locate all fields in the source which are defined in the open area, and will

import all data, as appropriate, regardless of data type discrepencies.

dbMerge( [, ] ) -> lSuccess

This function will import all data from the source file into the file in current work area.

If the current file is NOT empty then the lAppend optional argument must be set to .T. or

the function will abort the operation.

The function will locate all fields in the source which are defined in the open area, and will

import all data, as appropriate, regardless of data type discrepencies.

citação:

Achei o comando AddField() mas ainda não consegui identificar os arquivos necessários para a função ser usada corretamente.

SamirSSabreu@gmail.com

samirabreu@hotmail.com

Skype: SamirAbreu

xHarbour 1.1.0 + FwXh 8.02

id=black>

"Acreditar é mais fácil do que pensar: Daí existem muito mais crentes do que pensadores.†Bruce Calvert


id=quote>id=quote>

EMotta Sistemas

Eduardo Motta

emotta@gmail.com.br

FWH 9.09 - xHARBOUR 1.2.1

Fivewin desde 2000

xHarbour desde 2002

Link to comment
Share on other sites

Nada ainda, alguem tem outra idéia?

SamirSSabreu@gmail.com

samirabreu@hotmail.com

Skype: SamirAbreu

xHarbour 1.1.0 + FwXh 8.02id=black>

"Acreditar é mais fácil do que pensar: Daí existem muito mais crentes do que pensadores.†Bruce Calvert

Link to comment
Share on other sites

Colega vi que sua rotina é bem complexa e nao um simples replace, comigo usando apenas o replace para percorrer todo banco de dados mesmo com numero bem maior que o seu exemplo, levo coisas de minuto, mais isto usando recurso proprio do ADS, de uma olha no manual do giovany, vc vai ver como funciona o xcommit, xdbcommitall, xcopiaregistro quem sabe vc não ache algo para melhorar esta velocidade...

fontes

http://www.fivewin.com.br/exibedicas.asp?id=955

exemplos

http://www.fivewin.com.br/exibedicas.asp?id=909

Abraços

Luiz Fernando

msn: empresoft@globo.com

skype:empresoft

empresoft@globo.com

FWH 8.04,XHARBOUR 1.1,PELES,XDEV,VLIB,ADS 8.1

FWH 9.12,XHARBOUR 1.2,ADS 9.0

Link to comment
Share on other sites

Eu faço verificações para compatibilizar campos... pois já se mostrou necessário alterar o nome, tipo, tamanho e número de decimais dos campos...

SamirSSabreu@gmail.com

samirabreu@hotmail.com

Skype: SamirAbreu

xHarbour 1.1.0 + FwXh 8.02id=black>

"Acreditar é mais fácil do que pensar: Daí existem muito mais crentes do que pensadores.†Bruce Calvert

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...