I have seen various examples but I am unable to use DBI. How would I use a perl variable in an external sql script? For example the code in the perl script I would want would be:
$text = 'Germany';
@sql_output = `sqlplus -s user/pass\@databasename <<!
@/pathtofile/test.sql;
QUIT;
!`;
print @sql_output;
The sql script would be:
SELECT DISTINCT City FROM Customers
Where Country = '$text'
(Just as an example, I'm using the code comes from w3schools.com sql tutorial http://www.w3schools.com/SQl/trysql.asp?filename=trysql_select_distinct)
An example that I found through searching had:
@/pathtofile/test.sql $text;
But it did not work when I tried it with my code. Is this the correct way to incorporate a perl variable into an external sql script?