- Este tópico contém 4 respostas, 2 vozes e foi atualizado pela última vez 16 anos, 8 meses atrás por
mpvargas.
-
AutorPosts
-
28 de julho de 2009 às 12:48 am #88247
mpvargas
ParticipanteCaros Amigos,
Criei 2 tabelas iguais, uma com os dados e a outra somente a estrutura, crio um txt da tabela que tem os dados mas quando vou adicionar os dados na outra tabela dá erro… não entendo o porque…$ cat se2.ctl
load data
infile ‘/backup/sqlloader/se2.txt’
APPEND INTO table SE2010
fields terminated by “|” TRAILING NULLCOLS
(
E2_FILIAL,
E2_PREFIXO,
E2_NUM,
E2_VALOR,
E2_VENCTO,
E2_VENCREA,
E2_FORNECE,
E2_LOJA,
.
.
.
E2_STATUS,
E2_ATRASO,
E2_USERENT,
D_E_L_E_T_,
R_E_C_N_O_,
R_E_C_D_E_L_
)$ cat se2.txt | more
22|BHZ|CT0252| 68.25| | |UNIAO |00|UNIAO |01|TX
IRF | | | |
|12 |
Ref.Tit.CT0252 – TERRA FRANKLIN
| | 0| 0
| | |S| | 0| 0| 0| 0
0| 0| 0| 0| 0| 0| 0
0| | 0| 1| | | | | |
| | | 0| | | | | |
| | | | | | | | |
| | | | | 0| 0
68.25| 0| | | | 68.25| 0|
| | | | | | | 0| |22
| | | |
| | | | |
| |
| | | | | |0| 0| 0| | | | | 0| 0| 0|
| | | | | 0
| | 0| 003|IMP|000004| 881.25|20041130|20041130|001168|01|SO MACICO NITEROIENS|4 |NF
1 |20041109| | |
|03 |
0103
|2| 0| 0
20041130|237|20041109| |nb| 0| 0| 0| 0
0| 0| 0| 0| 0| 0| 881.25
0|20041130| 0| 1| | | | | |N
| | | 0|2| |S| | |014578
| |S|01|FINA050 | | |N| |
| | | | | 0| 0
0| 0| |2| | 881.25| 0|2
| | | | | | | 0| |
| | | |20041130
| | | | |
| |
| | | | | |$ cat se2.log | more
SQL*Loader: Release 10.2.0.1.0 – Production on Mon Jul 27 17:42:00 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: se2.ctl
Data File: /backup/sqlloader/se2.txt
Bad File: se2.bad
Discard File: none specified(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: ConventionalTable SE2010, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effectColumn Name Position Len Term Encl Datatype
—————————— ———- —– —- —- ———————
E2_FILIAL FIRST * | CHARACTER
E2_PREFIXO NEXT * | CHARACTER
E2_NUM NEXT * | CHARACTER
E2_VALOR NEXT * | CHARACTER
E2_VENCTO NEXT * | CHARACTER
E2_VENCREA NEXT * | CHARACTER
E2_FORNECE NEXT * | CHARACTER
E2_LOJA NEXT * | CHARACTER
E2_NOMFOR NEXT * | CHARACTER
E2_PARCELA NEXT * | CHARACTER
E2_TIPO NEXT * | CHARACTER
.
.
.
E2_STATUS NEXT * | CHARACTER
E2_ATRASO NEXT * | CHARACTER
E2_USERENT NEXT * | CHARACTER
D_E_L_E_T_ NEXT * | CHARACTER
R_E_C_N_O_ NEXT * | CHARACTER
R_E_C_D_E_L_ NEXT * | CHARACTERvalue used for ROWS parameter changed from 64 to 7
Record 1: Rejected – Error on table SE2010, column E2_NATUREZ.
ORA-01400: cannot insert NULL into (“MSIGA”.”SE2010″.”E2_NATUREZ”)Record 2: Rejected – Error on table SE2010, column E2_FILIAL.
ORA-12899: value too large for column “MSIGA”.”SE2010″.”E2_FILIAL” (actual: 10, maximum: 2)Record 3: Rejected – Error on table SE2010, column E2_FILIAL.
ORA-12899: value too large for column “MSIGA”.”SE2010″.”E2_FILIAL” (actual: 20, maximum: 2)Record 4: Rejected – Error on table SE2010, column E2_FILIAL.
ORA-12899: value too large for column “MSIGA”.”SE2010″.”E2_FILIAL” (actual: 80, maximum: 2)Record 5: Rejected – Error on table SE2010, column E2_FILIAL.
ORA-12899: value too large for column “MSIGA”.”SE2010″.”E2_FILIAL” (actual: 48, maximum: 2)28 de julho de 2009 às 3:00 am #88250Ishii
ParticipanteOlá,
Basicamente os erros são de estrutura mesmo, crie um cópia da SE2010 mas com as colunas superdimensionadas e todas com NULL e faça o insert. Depois faça a tratativa para a tabela SE2010 com os dados que estão faltando e truncando (quando possível) os valores maiores que o da tabela original.
[]s Ishii
28 de julho de 2009 às 4:57 pm #88262mpvargas
Participanteblz Ishii
Parece que é isso mesmo, mas porque isso acontece se a estrutura da tabela é a mesma?
Vou fazer conforme vc falou, alterando a estrutura…
Valeu pela ajuda.28 de julho de 2009 às 5:21 pm #88266Ishii
ParticipanteOlá,
Se não me engano o trailing nullcols entende que o espaço entre os pipes | está nulo quando não há valor… por isso o erro de “Cannot insert null…”
Já no caso do tamanho… está na mensagem mesmo…
[]s Ishii
28 de julho de 2009 às 5:33 pm #88267mpvargas
ParticipanteAchei que fosse o contrário…
Pensei que com essa opção ele iria ignorar os valores nulos, quero dizer, mesmo que na tabela fosse not null ele ia inserir…
Vou tirar a opção e testar novamente -
AutorPosts
- Você deve fazer login para responder a este tópico.