txtsql.bat
- set r=%time%
- echo %r%txt-sql开始导入 >>c:\txtsql\EC-import.txt
- rar a -agYYYYMMDDHHMM -df -o+ d:\input_bak\Oracle-EC- c:\input\*.txt
- winrar e -o+ oracle_files.zip c:\input
- osql -S (local) -U sa -P 123 -d EC -i c:\txtsql\txt-sql-ec.sql >>c:\txtsql\EC-import.txt
- set r=%time%
- echo %r%txtsql导入完成 >>c:\txtsql\EC-import.txt
txt-sql-ec.bat
- use [EC]
- --TRUNCATE TABLE mid_bom
- delete from mid_itm where dty < (getdate()-1)
- BULK INSERT mid_bom
- FROM 'C:\input\mid_bom.txt'
- WITH (
- FIELDTERMINATOR = ' ',
- ROWTERMINATOR = '\n'
- )
- BULK INSERT mid_cus
- FROM 'C:\input\mid_cus.txt'
- WITH (
- FIELDTERMINATOR = ' ',
- ROWTERMINATOR = '\n'
- )
PS,SQL语句有时需要使用换行和回车
Instr, Replace, Like 等语句或函数中使用回车换行符号
CHAR 可用于将控制字符插入字符串中。下表显示了一些常用的控制字符。
控制字符 值
制表符 CHAR(9)
换行符 CHAR(10)
回车 CHAR(13)
阅读(2244) | 评论(0) | 转发(0) |