Grupo
Tengo una tabla en MariaBD con 90mil registros, y me han pedido que yo exporte esos 90mil registros a un archivo TXT delimitado por tabulares
¿cómo puedo hacer eso?
De antemano agradezco la ayuda
Exportar tabla MariaDB a texto con tabulares
Moderator: Rathinagiri
-
- Posts: 183
- Joined: Mon May 19, 2014 7:43 pm
- DBs Used: DBF, SQLite, MS-SQL, ACCESS, MariaDB (en proceso)
- Location: Morelia, Mich. México
- Contact:
Exportar tabla MariaDB a texto con tabulares
Cordialmente
POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: posoft@gmx.com
POSADAS SOFTWARE
Jorge Posadas Ch.
Programador independiente
Morelia, Mich.
M é x i c o .
Movil +52 44 3734 1858
SKYPE: jorge.posadasch
Email: posoft@gmx.com
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Exportar tabla MariaDB a texto con tabulares
Do While function + ? command
just like DBF !
Serge
just like DBF !
Serge
There's nothing you can do that can't be done...
- vagblad
- Posts: 173
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: Exportar tabla MariaDB a texto con tabulares
Hello Jorge
Here is a very draft example, assuming connection with the database is already established
Here is a very draft example, assuming connection with the database is already established
Code: Select all
Local cTempString := ''
Local oRow, oQuery
cQueryString := 'SELECT * FROM yourTable "
oQuery := oServer:Query(cQueryString)
If oQuery:NetErr()
memowrit(cError, oQuery:Error() + ' --- ' + cQueryString)
EndIf
If oQuery:LastRec() > 0
For i := 1 to oQuery:LastRec()
oRow := oQuery:GetRow(i)
cTempString += oRow:FieldGet("Field 1") + ',' + oRow:FieldGet("Field 2") + ',' + oRow:FieldGet("Field X") + CRLF
Next i
EndIf
memowrit("mariadb.txt",cTempString)
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
- Ismach
- Posts: 164
- Joined: Wed Nov 28, 2012 5:55 pm
- DBs Used: DBF, mySQL, Mariadb, postgreSQL, Oracle, Db2, Interbase, Firebird, and SQLite
- Location: Buenos Aires - Argentina
Re: Exportar tabla MariaDB a texto con tabulares
En lulgar de poner un caracter de separador de columnas pone solamente Ascii 9 ylisto, asi:
Code: Select all
Local cTempString := ''
Local oRow, oQuery
cQueryString := 'SELECT * FROM TuPedorraTabla"
oQuery := oServer:Query(cQueryString)
If oQuery:NetErr()
memowrit(cError, oQuery:Error() + ' --- ' + cQueryString)
EndIf
If oQuery:RecCount() > 0
For i := 1 to oQuery:RecCount() Step 1
oRow := oQuery:GetRow(i)
cTempString += oRow:FieldGet("Col1") + Chr(9) + oRow:FieldGet("Col2") + Chr(9) + oRow:FieldGet("ColZ") + hb_OsNewLine()
Next i
EndIf
memowrit("TuPedorraTabla.plana.txt",cTempString)