?
Solved

Extracting Part Of SQL Output

Posted on 2009-07-07
3
Medium Priority
?
238 Views
Last Modified: 2013-12-19
Hello,

The displayed SQL will output the below entry:

LOCATION=c:\oradata\DB1\recovery1

Q:
How can I just output everything to the right of the equals sign?

Desired output:  c:\oradata\DB1\recovery1

Thanks,

Michael

SELECT value 
FROM v$parameter 
WHERE name='log_archive_dest_1';

Open in new window

0
Comment
Question by:michael4606
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Andytw earned 1800 total points
ID: 24793523
This should do it:
SELECT SUBSTR(value, INSTR(value,'=') + 1 )
FROM v$parameter 
WHERE name='log_archive_dest_1';

Open in new window

0
 
LVL 11

Assisted Solution

by:Andytw
Andytw earned 1800 total points
ID: 24793789
Just as a follow-up.  I see you're looking at the parameter log_archive_dest_n.  The format of this parameter doesn't necessarily *just* contain LOCATION="????", it consists of name/value pairs. So the value of this parameter could be, for example, 'LOCATION="e:\test\" OPTIONAL REOPEN=10.

In which case, something a bit more advanced is needed which can strip out just the location, if that's all you're interested in ...
SELECT regexp_replace(value,'LOCATION=(.+? ).*', '\1', 1,0,'i')
FROM v$parameter 
WHERE name='log_archive_dest_1';

Open in new window

0
 
LVL 32

Assisted Solution

by:awking00
awking00 earned 200 total points
ID: 24794544
Not sure what you intend to do with that result, but note that the value can also be null, so you may want to wrap an "nvl(...,default_destination_path) around Andytw's regular expression query.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question