I am finding it hard to write an if|else statement for the below condition. What I am doing is I have an Oracle database where I am running the below query and it returns output in rows (it can show records or it can return NULL values), what I want is if the row returned as output then it should execute couple of commands and if no rows are returned then it should execute second set of commands.
Example 1 -- it shows the output.
SQL> select value from v$parameter where name='spfile'; VALUE --------------- +DATA_01/TESTDB/spfileTESTDB.ora
Example 2 -- In some cases it can return no rows.
SQL> select value from v$parameter where name='spfile'; VALUE --------------