Jump to content
Fivewin Brasil

Erro para migrar dbf para mysql


edutraini

Recommended Posts

Bom dia, Pessoal

Tenho uma rotina que migra automaticamente o dbf para dentro do banco de dados mysql

tudo funciona perfeitamente

Um cliente meu instalou um novo servidor mysql em sua empresa e na hora de migrar o dbf para mysql esta dentro esse erro abaixo

ALguem poderia me dar uma dica do que possa ser

Error description: Error SR_MYSQL/0 SQLExecDirect Error

(1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Type=InnoDb' at line 31 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Type=InnoDb' at line 31

Command sent to database :

Link to comment
Share on other sites

Edu

Bom dia

Isto está um pouco genérico para ajudar, qual a versão do MySql instalada, Você utiliza algum RDD, como que é a rotina de conversão de dbf para MySql é feita em xHarbour com Five? Você usa algum utilitário externo? Você cria as tabelas via dbcreate ou CREATE TABLE?

Passa mais informações ai para podermos ter um norte para ajudar.

Att

João Bosco

Link to comment
Share on other sites

Faço dessa maneira abaixo

o arquivo arqdu é aonde esta o nome das tabelas para ele jogar para dentro mysql




USE ARQDU.dbf alias orig new

GO TOP

*

v:=1

A:=0

H1:=TIME()

Do While .not. eof()

vn_arq :=trim(orig->arqdbf)

IF !SR_EXISTTABLE(orig->arqdbf)

use &vn_arq alias temp new

aStr:=temp->(DBStruct())

DBCreate( trim(orig->arqdbf), aStr,"SQLRDD" )

USE &vn_arq SHARED ALIAS arqrdd NEW VIA "SQLRDD"

*

*---> Vou adicionar os registros.

*

WHILE(temp->(!Eof()))

arqrdd->(DBAppend())

FOR X = 1 TO temp->(FCount())

vCampo1:=temp->(FieldName(X))

vCampo2:=temp->&vCampo1

arqrdd->&vCampo1:=vCampo2

NEXT

temp->(DBSkip(1))

ENDDO

sele temp

dbclosearea()

Sele Arqrdd

DbClosearea()

*


SELE ORIG

SKIP

v=v+1

*

Enddo

H2:=TIME()

Retu(.T.)
Link to comment
Share on other sites

O problema é a versão do MySQL. Nas versões mais recentes, não se usa o Type=InnoDB e sim Engine=InnoDB. Se você está usando a SQLRDD, tens que ver se já tem uma versão que acesse as novas versões do MySQL. Ou se você tiver acesso à definição da tabela no MySQL, modifique para esse comando.

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...