Shell script on which I am working is having one SQL query which fetches multiple column and multiple rows from DB:
get_names() {
$ORACLE_HOME/bin/sqlplus -s usr/pwd <<EOF
SELECT id,name,age FROM table;
Exit;
EOF
}
Then, to read this result we are piping the function's output:
get_names | while read sid p_name p_age ; do ... done.
Now, because of |, a subshell is getting created, which I need to avoid.
Is there any alternative present for this issue?
We want to break that pipe statement to avoid child process of it.
sqlpluson another it must something else. You could write a program to do the work of that while but that would still be a process.