Config SQL*Plus to return nothing but data
I need to write a simple shell function that returns a single field from an Oracle DB. Think of it as for example SELECT 'ABC' FROM dual; and ABC is what I am after. Here is my function: function getSomeOraVal { sqlplus $USER/$PASSWD@$ORADB<<!! SET sqlprompt '' SET sqlnumber off SET verify off SET pages 0 SET echo off SET head on SET feedback off SET feed off SET serveroutput on SET escape '\' VARIABLE v_someVal VARCHAR2(30); BEGIN SELECT 'ABC' INTO v_someVal FROM dual; END; / SELECT :v_someVal FROM dual; !! } However, I want to pipe the sqlplus output (data only -> 'ABC') into a shell