Bug MySQL

Fórum sobre Banco de Dados e RDDs para Clipper/[x]Harbour.

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bug MySQL

Mensagem por JoséQuintas »

Nem perguntem.....
Salvando a bíblia em MySQL.

Mas num comando pesquisando o nome do meu filho.... eis que aparecem registros sem o nome.
Tanto faz com ou sem acento, as mesmas linhas aparecem.
biblia.png
Esquisito....

Pra quem quiser brincar no bom sentido....
Aqui em txt
https://umsocorpo.com.br/downloads/bibl ... corrigida/

Já avisando que tem alguns erros de digitação, onde foi trocado o número 1 pela letra L.
l1, l3, l4, etc., precisando de ajuste

E também alguns textos que foram divididos, precisando ajuste.

Código: Selecionar todos

#include "inkey.ch"

PROCEDURE PTESBIBLIA

   LOCAL cText, aText, cLine, cLivro := "", cCapitulo := "", cVersiculo, nKey, nId := 1
   LOCAL cnSQL := ADOClass():New( AppConexao() )

   SetMode( 30, 100 )
   CLS

   cText := MemoRead( "d:\temp\biblia.txt" )
   aText := hb_RegExSplit( hb_Eol(), cText )
   IF Len( aText ) < 2
      aText := hb_RegExSplit( Chr(13), cText )
   ENDIF
   WITH OBJECT cnSQL
      FOR EACH cLine IN aText
         cLine := AllTrim( cLine )
         IF Left( cLine, 1 ) $ "0123456789"
            cVersiculo := Substr( cLine, 1, At( " ", cLine ) - 1 )
            cLine := Substr( cLine, At( " ", cLine ) + 1 )
         ELSEIF Right( cLine, 1 ) $ "0123456789"
            cCapitulo := Substr( cLine, Rat( " ", cLine ) + 1 )
            cLine := Substr( cLine, 1, Rat( " ", cLine ) - 1 )
            cVersiculo := ""
         ELSE
            cLivro := cLine
            cCapitulo := ""
            cVersiculo := ""
         ENDIF
         :QueryCreate()
         :QueryAdd( "LIVRO", cLivro )
         :QueryAdd( "CAPITULO", cCapitulo )
         :QueryAdd( "VERSICULO", cVersiculo )
         :QueryAdd( "TEXTO", cLine )
         :QueryExecuteInsert( "biblia" )
         SayScroll( Str( nId++, 6 ) + " " + cLivro + "  " + cCapitulo + " " + cVersiculo )
         IF ( Upper( Left( cLine, 1 ) ) == "L" .AND. Substr( cLine, 2, 1 ) $ "0123456789" ) .OR. ;
            Len( cVersiculo ) > 25 .OR. Len( cCapitulo ) > 25 .OR. Len( cLivro ) > 25
            SayScroll( cLine )
            Inkey(20)
         ENDIF
         nKey := Inkey()
         IF nKey == K_ESC
            EXIT
         ENDIF
         IF nKey != 0
            Inkey(10)
         ENDIF
      NEXT
   ENDWITH

   RETURN
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bug MySQL

Mensagem por JoséQuintas »

biblia2.png
biblia3.png
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bug MySQL

Mensagem por JoséQuintas »

fulltext.png
Encontrei isso de índice FULLTEXT.
Mesmo assim, esquisito, ao comparar com o outro.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bug MySQL

Mensagem por JoséQuintas »

Me confundi por causa da ordem diferente.
Aqui a mesma coisa de 3 formas diferentes, mas uma delas falhou.
biblia.png
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bug MySQL

Mensagem por JoséQuintas »

Na verdade eu me confundi geral.

andré faz parte de alexandre.

Isso significa que dependendo da pesquisa, a acentuação pode ou não fazer diferença.

Pois é.... esse negócio de codepage e/ou acentuação vai longe....
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder