must be an easy one.
[edit] i am writing a BASH script, using HERE document to redirect some statements to SQL*Plus command-prompt.
sqlplus -s user/pw@db > $TMPFILE <<EOF
SET ECHO OFF;
SET FEEDBACK OFF;
SET HEADING OFF;
select x
from a_table
where a_field like '%$1%';
EXIT;
EOF
of course this doesn’t work as there is no substitution within single quotes. so how i go about doing this? i cannot do something like "'%$1%'" because double-quotes still go as input to SQL*Plus and cause error.
thank you.
It should work without modification
My simple tests works:
returns
This is because