ltpitt
asked on
Get a single value from sqlplus Oracle query
Hi all!
Executing a query on Oracle I get as output the table display.
The output looks like this:
PERCENT_SPACE_USED
------------------
20.05
SQL>
I would like to obtain as result only the numeric value.
I know I can fiddle with AWK or SED or other commands but I wanted to ask if there is any way in pure SQL to obtain the same result.
Thanks!
Executing a query on Oracle I get as output the table display.
The output looks like this:
PERCENT_SPACE_USED
------------------
20.05
SQL>
I would like to obtain as result only the numeric value.
I know I can fiddle with AWK or SED or other commands but I wanted to ask if there is any way in pure SQL to obtain the same result.
Thanks!
There are a lot of settings in sqlplus to allow for formatting and supressing header, alignment, SQL prompt and so on, but it isn't worth it to spend too much time on it. It's usually easier to filter e.g. for leading spaces to get the value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What makes you think that's not a numerical value? What is the relevant part of your query that produces that result?