SQL*Loader FAQ
转自:http://www.orafaq.com/wiki/SQL*Loader_FAQ#How_can_one_get_SQL.2ALoader_to_COMMIT_only_at_the_end_of_the_load_file.3F
Contents
[hide
]
1
What is SQL*Loader and what is it used for?
2
How does one use the SQL*Loader utility?
3
How does one load MS-Excel data into Oracle?
4
Is there a SQL*Unloader to download data to a flat file?
5
Can one load variable and fixed length data records?
6
Can one skip header records while loading?
7
Can one modify data as the database gets loaded?
8
Can one load data from multiple files/ into multiple tables at once?
9
Can one selectively load only the records that one needs?
10
Can one skip certain columns while loading data?
11
How does one load multi-line records?
12
How does one load records with multi-line fields?
13
How can one get SQL*Loader to COMMIT only at the end of the load file?
14
Can one improve the performance of SQL*Loader?
15
What is the difference between the conventional and direct path loader?
16
How does one use SQL*Loader to load images, sound clips and documents?
17
How does one load EBCDIC data?
[edit
]
What is SQL*Loader and what is it used for?
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database
. Its syntax is similar to that of the DB2
load utility, but comes with more options. SQL*Loader supports various load formats, selective loading, and multi-table loads.
SQL*Loader (sqlldr) is the utility to use for high
performance data loads. The data can be loaded from any text file and
inserted into the database.
[edit
]
How does one use the SQL*Loader utility?
One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility. Invoke the utility without arguments to get a list of available parameters. Look at the following example:
sqlldr username@server/password control=loader.ctl
sqlldr username/password@server control=loader.ctl
This sample control file (
相关文档:
分页语句
sqlserver 方案1: select top 10 * from t where id not in(select top 30 id from t order by id) order by id
方案2: select top 10 * from t where id in (select top 40 id from t order by id)oder by id desc
mysql: select * from t order by id limit 30,10
oracle: select * from (select rownu ......
先把程序打开,菜单上 Environment/Examples/Performance Examples 在空白处输入
要执行的程序,注意一定要正确,否则后果很严重,呵呵.
data: itab type table of TRDIR with header line.
select * from TRDIR into table itab
where NAME = 'ZHRRPT1011'.
read table itab with key name = 'ZHRRPT1011'.
......
今天又看到新加坡的同事发过来的一段SQL语句,还是老问题,时间对比直接用大于小于号。叹了声气后,手动给改成datediff了,可是一运行出错,错误提示如下:
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
为了说明方便,这里就简化一个例子好了。
create tab ......
select getdate()
是显示当前系统时间,输出的日期格式与本机日期格式有关,假入你想在什么情况下都显示成2006-12-15 10:37:00这种形式则需要转换一下
select convert(varchar(30),getdate(),20)
显示是星期几的语句是
select datename(weekday,getdate())
日期加星期的话直接加在一块就可以了
select convert(varcha ......