|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
目前在做一个sql loader遇到一个奇怪的问题,请大家帮忙看看,谢谢大家了。
此sql loader需要insert两个table(header和lines),control文件内容如下:
options (silent=(header,feedback,discards) )
load data
infile '/test/testappl/agt/1.0.0/bin/Invout.txt'
append
------------header
into table AGT.agt_trx_headers_all_temp
when (1) <> '/' and (4)='0'
FIELDS TERMINATED BY "~~"
TRAILING NULLCOLS
(
MACHINE_NUMBER char,
SHIPMENT_LIST_FLAG char,
SUB_MACHINE_COUNT decimal external,
VAT_CATEGORY char,
VAT_NUMBER decimal external,
LINES_COUNT decimal external,
VAT_DATE char,
VAT_MONTH char,
WORKBENCH_NUMBER char,
AMOUNT decimal external,
TAX_RATE decimal external,
TAX_AMOUNT decimal external,
CUSTOMER_NAME char,
CUSTOMER_REG char,
CUSTOMER_ADDRESS_TELEPHONE char,
CUSTOMER_BANK_ACCOUNT char,
COMPANY char,
COMPANY_REG char,
COMPANY_ADDRESS_TELEPHONE char,
COMPANY_BANK_ACCOUNT char,
COMMENTS char,
CREATE_VAT_USER char,
APPROVE_USER char,
RECEIPT_USER char,
HEADER_ID "agt_vatheaders_temp_s.nextval")
------------lines
into table AGT.agt_trx_lines_all_temp
when (1) <> '/' and (4)='S'
FIELDS TERMINATED BY "~~"
TRAILING NULLCOLS
(
DISCOUNT_FLAG char,
ITEM_NAME char,
ITEM_MODEL char,
UOM_CODE char,
QUANTITY decimal external,
AMOUNT decimal external,
TAX_RATE decimal external,
TAX_AMOUNT decimal external,
UNIT_PRICE decimal external,
TAX_FLAG char,
TAX_MODEL char,
LINE_ID "agt_vatlines_temp_s.nextval")
txt文件为附件内容,当我将control文件中lines部分拿掉程式运行结果正确,将header部分拿掉运行结果也正确(lines会有资料塞入db),但是这两部分同时存在时(即上面文档)lines就不能insert资料进去了,log提示 :
Table AGT.AGT_TRX_HEADERS_ALL_TEMP:
1 Row successfully loaded.
0 Rows not loaded due to data errors.
4 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Table AGT.AGT_TRX_LINES_ALL_TEMP:
0 Rows successfully loaded.
0 Rows not loaded due to data errors.
1 Row not loaded because all WHEN clauses were failed.
4 Rows not loaded because all fields were null.
txt文件内容如下:
//发票1
0~~0~~0~~1101001140~~10000009~~5~~20061117~~11~~AGT-11875-2~~7301.00~~0.17~~1241.17~~AT&T Universal Card~~321000X89010001~~5645 Main Street,8441212~~China Bank001,China Bank AAAA~~ares~~110101000000000~~北京市海淀区知春路61号 68744498~~工行123455668-234222256111~~Golden Tax Adaptor Invoice~~管理员~~Tina~~Terry
0~~Standard Product~~~~Ea~~10~~1000.00~~0.17~~170.00~~100~~0~~Sale
0~~Senior Consultant~~~~HRS~~10~~3500.00~~0.17~~595.00~~350~~0~~Sale
0~~Staff Consultant~~~~HRS~~10~~2750.00~~0.17~~467.50~~275~~0~~Sale
0~~Special Agreement~~~~EA~~1~~200.00~~0.17~~34.00~~200~~0~~Sale
感觉很奇怪,lines table中栏位均为可以为空的。 |
|