I have a SQL script and a sh executable to run a script doing some operations on my database.
My principal problem is I'm searching how I could do the following thing:
Send an array of parameter from my bash parameters when launching the script, my actual command is:
./myscript.sh databaseName user thirdParameterToPassAsAString
'fourthParameterElement1','fourthParameterElement2','fourthParameterElement3'
the content of my script:
#!/bin/bash
set -e
psql $1 $2 <<EOF
set search_path = search_path;
set firstParameterusedinSQLScript = $3;
set Param_List = $4;
\i my_script.sql
EOF
and the sql part where I have the problem:
where ae.example in (:Param_List)
I have of course some issues with this where clause.
So the question is how could i do this?