From: Dobrica Pavlinusic Date: Mon, 3 Nov 2008 20:42:55 +0000 (+0000) Subject: added configuration example and improved pod a bit X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=1bc45409162d16a0a5d65a637066b20e66418fb8;p=SQL2XLS added configuration example and improved pod a bit git-svn-id: svn://svn.rot13.org/SQL2XLS@14 2e857b76-582b-47e5-ad5c-b3ba0f0ee29b --- diff --git a/sql2xls.cgi b/sql2xls.cgi index cd5f2e8..f6a39d4 100755 --- a/sql2xls.cgi +++ b/sql2xls.cgi @@ -8,19 +8,19 @@ sql2xls.pl - convert sql queries on file system to Excel file =head1 USAGE -Each file in current directory which ends in C<< *.sql >> will +Each file in current directory which ends in C<*.sql> will be converted to Excel sheet. If you want to have specific order, you can prefix filenames with numbers which will be striped when creating sheet names. -Comments in sql files (lines beginning with --) will be placed +Comments in sql files (lines beginning with C<-->) will be placed in first line in bold. To specify database on which SQL query is executed -C<< \c database >> syntax is supported. +C<\c database> syntax is supported. You can also run script from command line, and it will produce -C<< sql_reports.xls >> file. +C file. If run within directory, it will use files in it to produce file. @@ -39,9 +39,28 @@ drop this script anywhere, but you can also add something like in Apache's virtual host configuration to get nice URLs +To configure default database, user, password and other settings create +C file in same directory in which C is with something +like this: + + $dsn = 'DBI:mysql:dbname='; + $database = 'database'; + $user = 'user'; + $passwd = 'password'; + $path = 'sql_reports.xls'; + + $db_encoding = 'utf-8'; + $xls_date_format = 'dd.mm.yyyy'; + + $debug = 1; + +=head1 SECURITY + +There is none. Use apache auth modules if you need it. + =head1 AUTHOR -Dobrica Pavlinusic, dpavlin@rot13.org +Dobrica Pavlinusic, dpavlin@rot13.org, L =cut