TDOLPHIN, example to compare and update table

TDOLPHIN, example to compare and update table

Postby MGA » Sun Sep 08, 2013 2:46 pm

friends,

using TDOLPHIN, someone would have an example to compare and update table in MYSQL?

thank you
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: TDOLPHIN, example to compare and update table

Postby Daniel Garcia-Gil » Mon Sep 09, 2013 1:46 am

hello

sorry, but i dont undertstand what do you need...

compare two entire tables? compare if a record was modify? compare values?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDOLPHIN, example to compare and update table

Postby MGA » Mon Sep 09, 2013 3:18 pm

Algo assim:

for n := 1 to len(aAlteracoes)

cQuery := "ALTER TABLE " + cTabela + " "

do Case
case aAlteracoes[n,'nProcedimento'] == ATUALIZACAO_CAMPO_EXCLUIDO
cQuery += "DROP COLUMN `" + Alltrim(aAlteracoes[n,'cNome']) + "`"

case aAlteracoes[n,'nProcedimento'] == ATUALIZACAO_CAMPO_ALTERADO
cQuery += "MODIFY COLUMN " + DefinicaoColuna(aAlteracoes[n]) + " " + PosicaoColuna(aAlteracoes[n, 'cCampoAnterior'])

case aAlteracoes[n,'nProcedimento'] == ATUALIZACAO_CAMPO_INCLUIDO
cQuery += "ADD COLUMN " + DefinicaoColuna(aAlteracoes[n]) + " " + PosicaoColuna(aAlteracoes[n, 'cCampoAnterior'])
otherwise
loop
endcase

//QUERY
if !M->oServer:Execute(cQuery)
MsgStop('Não foi possível atualizar a tabela: '+cTabela+CRLF+CRLF+'Query: '+cQuery,'Atenção!')
endif
next
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: TDOLPHIN, example to compare and update table

Postby Daniel Garcia-Gil » Mon Sep 09, 2013 7:56 pm

Hello

sorry, but dolphin haven't method to compare two tables structures.... you can do same way that above example
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDOLPHIN, example to compare and update table

Postby MGA » Mon Sep 09, 2013 8:34 pm

yes, I'm implementing...

thanks
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests