| 1 | #!/usr/local/bin/perl | ||
| 2 | use Getopt::Long qw(:config no_ignore_case); | ||
| 3 | use SimpleDBI; | ||
| 4 | GetOptions (\%h, | ||
| 5 | 'type|t=s', | ||
| 6 | 'host|h=s', | ||
| 7 | 'usr|u=s', | ||
| 8 | 'passwd|p=s', | ||
| 9 | 'port|P=s', | ||
| 10 | 'db|d=s', | ||
| 11 | 'query|e=s', | ||
| 12 | 'file|f=s', | ||
| 13 | 'sep|s=s', | ||
| 14 | 'charset|c=s', | ||
| 15 | 'write_head|H=i', | ||
| 16 | ); | ||
| 17 | |||
| 18 | my $dbi = SimpleDBI->new(%h); | ||
| 19 | $dbi->query_db($h{query}, %$dbi, result_type => 'file'); |