#!/usr/bin/perl -w

use strict;
use lib "../Perl/modules";
use GenomicsUtils;

my $helpStr=qq{

  Instruction:

    sqlQuery.pl <db Host> 'query statement'

	'query statement' in single quote!


  Description:
	
	This script queries the genomics_test database
	and returns the results in tab-delimited format.


};


unless (@ARGV==2){die "$helpStr";}
my ($host, $qStatement) = @ARGV;

GenomicsUtils::connect("$host");

my $dataR = GenomicsUtils::query(qq{$qStatement});

foreach my $ref (@$dataR){
    if ($ref){	
    	print join "\t", @$ref;
	print "\n";
    }
}

GenomicsUtils::disconnect();
exit;
