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
oid | Pno | Pdate | Pid | addrs | Ph:no | Amt | Flag | company | employee | _FK1 | _FK2 | _FK3 | _FK4 | _FK5 | _FK6 |
---|
1 | 001 | 01/01/2013 | 23 | xyz | 3333333 | 34 | Y | great | DOC | 1 | 5 | 1 | 4 | 1 | 1 |
2 | 002 | 01/01/2014 | 25 | pqr | 2222222 | 38 | N | New | SOS | 1 | 2 | 4 | 1 | 2 | 2 |
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