JackTheRussel
Programmer
Hi all.
I have program where I have GetOption structure:
So user can give example time, name and product information in command line like this:
./script -t begin=19.9.2006 end=20.9.2006 -n=john -p 3
And I can get values like this:
print "Start time: ", $time{begin};
print "End time: ", $time{end};
print "name: ", $name;
print "prodID", $productID;
But how I can build "generic" SQL-queries in these values?
What I mean is that user dont always give all values.
example user can give ONLY name or just productID and name etc...
so please give me some advice. I have no clue.
I have program where I have GetOption structure:
Code:
GetOption('t|time=s' => %time,
'n|name=s' => $name,
'p|prodID=i' => $productID);
So user can give example time, name and product information in command line like this:
./script -t begin=19.9.2006 end=20.9.2006 -n=john -p 3
And I can get values like this:
print "Start time: ", $time{begin};
print "End time: ", $time{end};
print "name: ", $name;
print "prodID", $productID;
But how I can build "generic" SQL-queries in these values?
What I mean is that user dont always give all values.
example user can give ONLY name or just productID and name etc...
so please give me some advice. I have no clue.