Subject Re: [firebird-support] Export to CSV
Author Milan Babuskov
sgharp wrote:
> I have to provide an export feature which will output all tables and
> all data to CSV files (one for each table). Is it possible to
> create text files from within a stored procedure? Better yet, is
> there a better way to do this?

You can use my FBExport tool. Check out the URL in my signature.

If you have to do it on regular basis, you can create a script to use
command-line version to do it for you.

1. Create fbexport command for each table like this:

select 'fbexport -Sc -V ' || RDB$RELATION_NAME || ' -F ' ||
RDB$RELATION_NAME || '.out [other_params]'
from RDB$RELATIONS
where (RDB$SYSTEM_FLAG = 0 or RDB$SYSTEM_FLAG is null)
and RDB$VIEW_SOURCE is null ORDER BY 1

2. Replace [other params] with other fbexport parameters like
database_name, username, password, etc.

3. run the script.

Each time you need to export, just run the script again.

--
Milan Babuskov
http://fbexport.sourceforge.net