← Back to team overview

maria-discuss team mailing list archive

Re: Read/Write file

 

Hi,

There is no programmatic way to read a file line by line and write a file line by line.  You could write a udf to do so.

You can take a look at http://github.com/Fastbit_UDF if you like.  fb_query() writes to CSV files and fb_inlist reads a one column file and turns it into an CSV list for use with IN predicates.

You could construct a read_line udf and write_line udf that take a file name and offset as the first two params.  If you really need such a set of UDF I  can write and test them for a consulting fee.  Contact me if you are interested.

Sent from my iPhone

> On Mar 12, 2016, at 5:13 AM, Sergei Golubchik <serg@xxxxxxxxxxx> wrote:
> 
> Hi, Ghazi!
> 
>> On Mar 12, Ghazi Btissam wrote:
>> Hi,
>> 
>> How to read/write a text file from a MariaDb routine ? Is this possible
>> only via tables (loading via Load data infile or using connect engine..)?
> 
> No, there is also LOAD_FILE function:
> https://mariadb.com/kb/en/mariadb/load_file/
> 
> Regards,
> Sergei
> Chief Architect MariaDB
> and security@xxxxxxxxxxx
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-discuss
> Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-discuss
> More help   : https://help.launchpad.net/ListHelp


References