In a unix script I am calling below SQL which contains a value for the column company_name with &
symbol: 'SK&CO'
and other value(city,date) I am passing through script
select * from stock_details where company_name ='SK&CO' --value hardcoded
and city = &2
and date = &1;
How do I keep the &
(ampersand) in the SQL with other substitute variable values?
I have tried set define off
, which is not working as I need to use other substitute variable values
set define off
, will escape all the substitute values where I want to ignore substitution for the single & and treat this as a value to show the result output with matching values.