I am trying to store SQL query result into an array in a shell script but I face an invalid identifier error when I run my .sh
Could you please check what matter in my code?
#!/usr/bin/ksh
echo Start Executing SQL commands
array=$(sqlplus -s apps/apps << eof
SET PAGESIZE 0;
SELECT directory_name from all_directories where directory_name like '%XXBP%';
eof)
printf '%s\n' "${array[@]}"
This is the error I get:
I know the problem comes from my operator % but I need it to restrict the result of my query.