Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generating multiple rows of fixed length output for each record

3244859Jun 12 2016 — edited Jun 13 2016

I have a table that has a lot of information. you can call it a FACT table if you want to.Sample example below


Table F

oidPnoPdatePidaddrsPh:noAmtFlagcompanyemployee_FK1_FK2_FK3_FK4_FK5_FK6
100101/01/201323xyz333333334YgreatDOC151411
200201/01/201425pqr222222238NNewSOS12

4

122

I want to create a SQl that generates an output which splits each unique record in the FACT into multiple fixed length rows.Like Below

'SQ1'||001                           23                                                     great                                        DOC ----> length is 100. Pno is in field 3 to 5,Pid in field 15 to 16. company name in field 56 to 70

'SQ2'||001           'Y'                          'DOC'          34         'XYZ'                            3333333                         ----->length is 120

***********************************similar format for 2nd record below****************************************************************** 

'SQ1'||002                           25                                                     New                                       SOS----> length is 100,

'SQ2'||002           'Y'                          'SOS'          38         'PQR'                            2222222                         ----->length is 120


continue displaying the split records for the selected records in the fact

    

 

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 11 2016
Added on Jun 12 2016
3 comments
697 views