Home » RDBMS Server » Server Utilities » concatenate parts of a row in sql loader
concatenate parts of a row in sql loader [message #70327] Mon, 27 May 2002 03:43 Go to next message
Antoni
Messages: 8
Registered: February 2002
Junior Member
Hi,
does anybody knows how to concatenate part of a row into a field?

This is my code but it is giving me problems

LOAD DATA
INFILE "/usr/users/medios/enlaces/T202_XXOXIFXX.LST"
APPEND
INTO TABLE VENTAS_FRIGO_PROVA
(
VTAS_CODCLI POSITION ( 001 : 015 ),
VTAS_SEMANA POSITION ( 031 : 037 ) "SUBSTR(RTRIM(LTRIM(:VTAS_SEMANA)),4,7)||SUBSTR(RTRIM(LTRIM(:VTAS_SEMANA)),1,2)))",
VTAS_PRODUCTO POSITION ( 016 : 030 ),
VTAS_UNIDADES POSITION ( 067 : 087 ) NULLIF VTAS_UNIDADES = BLANKS,
VTAS_GSV POSITION ( 109 : 129 ) NULLIF VTAS_GSV = BLANKS,
VTAS_TPR POSITION ( 151 : 171 ) NULLIF VTAS_TPR = BLANKS,
VTAS_LITONS POSITION ( 046 : 066 ) NULLIF VTAS_LITONS = BLANKS
)

I have this kind of data in the data field:

20_2002 and I want to insert 200220 in vtas_semana.

The code above it is not working i got

ORA-00947: not enough values

thanks in advance
Re: concatenate parts of a row in sql loader [message #70373 is a reply to message #70327] Tue, 04 June 2002 12:10 Go to previous message
Mike
Messages: 417
Registered: September 1998
Senior Member
If you haven't solved the probelm, here could be the possible solution.

VTAS_SEMANA POSITION ( 031 : 037 ) "SUBSTR(:VTAS_SEMANA,4,4)||SUBSTR(:VTAS_SEMANA,1,2)",

Good Luck
Previous Topic: Sqlldr Help!
Next Topic: Can I replace 0 instread "N/A" HELP!!
Goto Forum:
  


Current Time: Thu Apr 25 02:12:36 CDT 2024