Inserting a value in table

Database
Enthusiast

Inserting a value in table

I have column value like CUST.ONGOING |REVENUES Voice Monthly Fees-Contract. I want to extract data which is before pipe delimiter as one column and data after pipe delimiter as another column.
Can anyone please suggest which functions in the teradata can be used?
2 REPLIES
Enthusiast

Re: Inserting a value in table

Substring and Position (or Substr and Index - they are the non ANSI versions):

Create Volatile Table T1
(PK Integer Not Null
, InCol Varchar(120) Not Null
Unique Primary Index (PK)
On Commit Preserve Rows
;

Insert Into T1 Values (1, 'CUST.ONGOING |REVENUES Voice Monthly Fees-Contract');

Select * FRom T1;

Select PK
, InCol
, Substring(InCol From 1 For Position('|' in InCol)-1)
, Substring(InCol From Position('|' in InCol)+1)
From T1
;
Enthusiast

Re: Inserting a value in table

Thanks Jimm..This helped....Gr8