X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fwrite_mysql;h=2d0a2142f83ea0cc15f7efa38fe94f4d6f7a4280;hb=5aa6482643719c640f828c37a4ab23cde28be591;hp=1a783bf7396022fb41445a5c057327f660d7ddf3;hpb=adf6979cf0f222b6d8ad419f798fb82dbe4b99bb;p=biopieces.git diff --git a/bp_bin/write_mysql b/bp_bin/write_mysql index 1a783bf..2d0a214 100755 --- a/bp_bin/write_mysql +++ b/bp_bin/write_mysql @@ -39,8 +39,8 @@ use Maasha::Calc; my ( $options, $user, $password, $dbh, $in, $out, $tmp_dir, $tmp_file, $fh_out, $record, $key, $type_hash, $i, @keys, $line ); -$user = $ENV{ "USER" }; -$password = $ENV{ "USER" }; +$user = Maasha::Biopieces::biopiecesrc( "MYSQL_USER" ); +$password = Maasha::Biopieces::biopiecesrc( "MYSQL_PASSWORD" ); $options = Maasha::Biopieces::parse_options( [ @@ -122,6 +122,10 @@ if ( Maasha::SQL::table_exists( $dbh, $options->{ 'table' } ) ) create_table( $dbh, $options->{ 'table' }, $type_hash, $options->{ 'index' }, $options->{ 'verbose' } ); } } +else +{ + create_table( $dbh, $options->{ 'table' }, $type_hash, $options->{ 'index' }, $options->{ 'verbose' } ); +} Maasha::SQL::bulk_load_file( $dbh, $tmp_file, $options->{ 'table' }, "\t" ) if Maasha::SQL::table_exists( $dbh, $options->{ 'table' } );