dbTalk Databases Forums  

Is it possible in SQL or PL/SQL

comp.databases.oracle.server comp.databases.oracle.server


Discuss Is it possible in SQL or PL/SQL in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
toto
 
Posts: n/a

Default Is it possible in SQL or PL/SQL - 04-04-2006 , 03:02 AM






Hi,

I am using Oracle 9.2 database. I am having following data

drop table toto;
create table toto
(
r char(10)
)
organization external
(
type oracle_loader
default directory data_dir
access parameters
(
records delimited by newline
logfile data_dir:'toto.log'
)
location ('pp.sysout')
)
reject limit unlimited
/

In pp.sysout I am having following data

A
B
C
D=10
E
F
G
A
B
C
D=20
E
F
G
H
I
A
B
C
D=20
E
F
G
H
A
B
C
D=30
E
F
G
H

I want set of results in a different spool file starting from 'A' upto
next 'A'
where value of 'D' is unique.

For e.g.
1. spool file xxx.1 will contain
A
B
C
D=10
E
F
G

2. spool file xxx.2 will contain ( it will have two sets because D=20
appearing
twice in data )

A
B
C
D=20
E
F
G
H
I
A
B
C
D=20
E
F
G
H

3. spool file xxx.3 will contain

A
B
C
D=30
E
F
G
H

Kindly let me know is it possible to do that ? if yes pl show me how.

thanks & regards
pjp


Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Is it possible in SQL or PL/SQL - 04-04-2006 , 03:11 PM






toto wrote:
Quote:
Hi,

I am using Oracle 9.2 database. I am having following data

drop table toto;
create table toto
(
r char(10)
)
organization external
(
type oracle_loader
default directory data_dir
access parameters
(
records delimited by newline
logfile data_dir:'toto.log'
)
location ('pp.sysout')
)
reject limit unlimited
/

In pp.sysout I am having following data

A
B
C
D=10
E
F
G
A
B
C
D=20
E
F
G
H
I
A
B
C
D=20
E
F
G
H
A
B
C
D=30
E
F
G
H

I want set of results in a different spool file starting from 'A' upto
next 'A'
where value of 'D' is unique.

For e.g.
1. spool file xxx.1 will contain
A
B
C
D=10
E
F
G

2. spool file xxx.2 will contain ( it will have two sets because D=20
appearing
twice in data )

A
B
C
D=20
E
F
G
H
I
A
B
C
D=20
E
F
G
H

3. spool file xxx.3 will contain

A
B
C
D=30
E
F
G
H

Kindly let me know is it possible to do that ? if yes pl show me how.

thanks & regards
pjp
Your explanation requires an explanation. I have no idea what you are
trying to do and it looks a lot like someone needs to rethink the design.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.