Solved

Extracting Part Of SQL Output

Posted on 2009-07-07
3
236 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 450 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 450 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 50 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

707 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