I use the software SQuirreL SQL Client Version 3.2.1 and I want to declare variable like
define dateFrom = '13/04/2012';
define dateTo = '13/04/2012'
And to use it in my sql query like that
SELECT * FROM table_name WHERE TRUNC(column_name) BETWEEN to_date('&dateFrom','YYYY-MM-DD') AND to_date('&dateTo','YYYY-MM-DD');
But it doesn't work. How can I define and use variable in SQuirreL.
Maybe not quite what you want, but have you tried loading plugin 'sqlparam'? It offers variable substition, e.g.
SELECT * FROM table_name WHERE TRUNC(column_name) BETWEEN :dateFrom and :dataTo
When running this query Squirrel will ask for values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With