teradata utility bteq

Tools

teradata utility bteq

Hi All,

I had the below req

there is a source table where it contains two columns as below

col1 col2

laxman 25:34:56

rama 64:1:34:57:56

raja 1:2:5

rani 4:9:0:8

I need to write an utility thru which i shud get the following output

Target1 - table

where col1 is a unique id generated w.r.t col2 of target1 and col2 are distinct id`s from src(col2)

col1 col2

1 25

2 34

3 56

4 64

5 1

6 57

7 2

8 5

9 4

10 9

11 0

12 8

and Target2 as follows

col1 col2

laxman 25

laxman 34

laxman 56

rama 64

rama 1

rama 34

rama 57

rama 56

raja 1

raja 2

raja 5

rani 4

rani 9

rani 0

rani 8

Hope u understand the rq i need the bteq script urgently or plz help me out with any suggestions