My requirement is to store the result of an sqlplus operation into a variable in my shell script. I need the result of the following operation which is in my .sh file
sqlplus 'user/pwd' @test.sql
I have already tried
testvar = 'sqlplus 'user/pwd'
@test.sql'
but that doesn't work.
EDIT::
I changed it to
testvar=sqlplus foo/bar@SCHM @test.sql
and it says
SQL*Plus:: not found [No such file or directory]
I tried with
testvar=$(sqlplus foo/bar@SCHM
@test.sql)
and it gives the same error. When I try without the variable assignment like below
sqlplus foo/bar@schm @test.sql
it works fine
=.