Re: DECODE Question again
Date: 1996/11/10
Message-ID: <566d08$npa_at_nnrp1.news.primenet.com>#1/1
Systems Admin <sysadmin_at_doj.vic.gov.au> wrote:
>Sorry, a bit of the message was left off, try again:
>I have a column called DISK_NAME which is a VARCHAR2(22).
>It contains data in the following form:
>DISK_NAME
>----------------------
>(dgsc(vme(0),1,7),0,0)
>(dgsc(vme(0),1,7),0,1)
>(dgsc(vme(0),1,7),0,2)
>(dgsc(vme(0),1,7),0,3)
>(dgsc(vme(0),1,7),0,4)
>(dgsc(vme(0),1,7),0,0)
>(dgsc(vme(0),1,7),0,1)
>(dgsc(vme(0),1,7),0,2)
>(dgsc(vme(0),1,7),0,3)
>(dgsc(vme(0),1,7),0,4)
>(dgsc(vme(0),1,7),0,0)
>I want to load this with SQL*Loader and want to decode it before it
>hits the table, so I tried this in the CTL file :
>disk_name position(33:40) CHAR
> decode('disk_name','(dgsc(vme(0),1,7),0,4)','sdisk174')
>However, although the LOG file shows no errors, the column is empty
>when I do a select from the table. If I put 'xxx' after the 'sdisk174'
>in the CTL file, this gets loaded ok.
>Also, if I load the data in the original form, when I do a
>SELECT
> DECODE('disk_name','(dgsc(vme(0),1,7),0,4)','sdisk174')
>FROM diskstats;
>It also shows an empty column.
>What am I missing?
>Thanks,
>Andy Horne
Have you checked to see if any of the data you are entering matches the string you are testing for? Since you have not supplied the decode with a default value, this is more than likely why the values are null. Received on Sun Nov 10 1996 - 00:00:00 CET