PL/SQL (MOSC)

MOSC Banner

How do we join two lines in oracle and grep for a word from line

edited Nov 14, 2011 8:00PM in PL/SQL (MOSC) 16 comments
Hi,

I have a text file with some lines like the following.I want to make it single line,say,make the select statement in one line and to cutonly table name from that line.

select name
from
emp
where id='20'

select id from
dept
where
dept like 'Or%'
-----------------
I want the output like
select name from emp where id='20'

select id from dept where dept like 'Or%'

How do i check for new line character and Concatenate it?Also i want grep the 1st word after 'from'.
Thanks.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center