What RDBMS are you going against?
What is 'CurrentDate'? Is this a value you're passing in? Do you want the SQL query to grab the current system time from the RDBMS? Something else?
Assuming 'CurrentDate' is supposed to be the current time in the RDBMS, then a very simple example using 'isql' to run the query against SAP/Sybase ASE:
========================
# at UNIX command prompt:
$ isql -S <ASE_server_name> -U <ASE_login> -P <password> -w2000 <<-EOF > <your_output_file_name>
use <database>
go
select * from TCURR where GDATU = getdate()
go
EOF
========================
This will direct the output to an OS file named <your_output_file_name>.
The '-w2000' tells isql to break the output onto separate lines after 2000 characters.
Obviously it's up to the coder to add error/exceptions handling, parse the output file as needed, etc.