How can I create Oracle view that splits varchar into multiple columns? - TechRepublic
Question
January 25, 2008 at 10:01 AM
gjbloom

How can I create Oracle view that splits varchar into multiple columns?

by gjbloom . Updated 18 years, 4 months ago

A dblinked table contains a varchar2(500 bytes) column, which contains a series fixed-length set of values, all concatenated into this one varchar. I need to create a local view of this dblinked table that breaks the fixed-length values into distinct columns. For example, say the original varchar column is composed of:

Name Len Offset Type
CUST_NAME 20 0 Char
SENIORITY 3 20 Num
CONCESSION_IND 4 23 Char

I need to make my local view actually break out these three values into separate columns. (I actually need to break out 126 columns from the original varchar2(500 byte) column).

Can anyone suggest an efficient way to do this? If I create some elaborate select that defines my view by picking out each field, will it perform reasonably well, or will it be painfully slow to select data from?

This discussion is locked

All Comments