Page 1 of 1

MARIADB Export Rowset

Posted: Tue Feb 23, 2021 11:10 pm
by Adolfo
Hi fivewinners

Is there a metod in Mariadb to export a row set to a txt file.
Just like Tdolphin with...

oQry:=cSvr:Query("select * from datos")
oExp:=oQry:Export( EXP_TEXT, "C:\XXXXX\EXPORT" )
oExp:Start()
oExp:Close()

or something like that.

Thanks in advance

Re: MARIADB Export Rowset

Posted: Wed Feb 24, 2021 12:00 pm
by nageswaragunupudi
Please try

Code: Select all

cText := oCn:SqlToText( cSql )
MEMOWRIT( cFile, cText )
 

Re: MARIADB Export Rowset

Posted: Thu Feb 25, 2021 11:47 am
by Adolfo
Thanks..
Works great...

Re: MARIADB Export Rowset

Posted: Thu Feb 25, 2021 6:03 pm
by MOISES
Mr. Rao,

Can we please have this SqlToText for ADO?

Thank you

Re: MARIADB Export Rowset

Posted: Thu Feb 25, 2021 10:57 pm
by nageswaragunupudi
Please try

Code: Select all

cText := ""
AEval( RsGetRows( oRs ), { |a| cText += ( FW_ArrayAsList( a, Chr(9) ) + CRLF ) } )
MEMOWRIT( cFile, cText )
 

Re: MARIADB Export Rowset

Posted: Fri Feb 26, 2021 1:24 am
by MOISES
Yes, it works correctly, it exports the rows.

But what I would really need would be the backup() method for ADO, to save in a txt file the content of the database in SQL mode INSERT INTO CITIES( CODE, CITY ) VALUES ( "1", "Madrid") ...

Would it be possible please?