Capture a database val and use in script

Hello, sorry if this has been asked before, I couldn't find what I was looking for.

I know how to connect to Oracle and execute stored procedures from a shell script, but what I would like to do is return a value from a table and use it in my script.

For Example, If I had a table Called TableX that had a value called ProcessToday and it was set to 'Y', I would like to read that value and set a variable in my shell script so I could do something like

TheValue= (returned value from query)

if [ $TheValue = 'Y']
   .....

Anyone know if this is possible and how I would set this up? Thanks in advance.

Save the returned output to a variable or file and parse it in your shell script.

Basic example:

... maybe put some sqlplus settings here to get not too much garbage etc...
... and set the environment needed for your DB user, if not already done...
VAR=$( sqlplus user/pw @ ... )

If you get more output, parsing will be needed.

Here is one of many hits on Google how to issue sqlplus from a shell script which is demonstrated more in detail:
https://forums.oracle.com/thread/2174382