Chinaunix首页 | 论坛 | 博客
  • 博客访问: 530012
  • 博文数量: 134
  • 博客积分: 7990
  • 博客等级: 少将
  • 技术积分: 1290
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-29 11:43
文章分类

全部博文(134)

文章存档

2009年(7)

2008年(80)

2007年(47)

我的朋友

分类: Oracle

2007-12-06 23:35:04

经常有人问excel报表如何导入到oracle里,toad提供了这个功能,我们来做个简单的实验,一步一步把excel报表导入到oracle里。

一:

  先建立个测试的excel报表test.xls(1)     

 

     
                                        (图1)
二:在scott用户下建立一test表

[oracle@hundsun ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 6 19:33:52 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

idle> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
idle> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@hundsun ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 6 19:34:21 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

sys@NIUGE> conn scott/tiger
Connected.
scott@NIUGE> create table t(id_no int,id_no1 int,id_no2 int,id_no3 int,id_no4 int,id_no5 int);
create table t(id_no int,id_no1 int,id_no2 int,id_no3 int,id_no4 int,id_no5 int)
             *
ERROR at line 1:
ORA-00955: name is already used by an existing object


scott@NIUGE> c /t(/test(/
  1* create table test(id_no int,id_no1 int,id_no2 int,id_no3 int,id_no4 int,id_no5 int)
scott@NIUGE> r
  1* create table test(id_no int,id_no1 int,id_no2 int,id_no3 int,id_no4 int,id_no5 int)

Table created.

scott@NIUGE> select * from test;

no rows selected

三:

   进入toad 选择Database------Import----Table Data (如图2)                          (图2)

 

四: Schema 选择 SCOTT (如图3                                                                       (图3)

五:Table 选择 TEST (如图4                                  (图4)

 

六:Commit Mode 选择第二项,可以根据实际情况自己选择(如图5 

                                      (图5)

七:点击 Show Data 选项 ,然后在点击Execute Wizard选项---选择Excel file选项(如图6

                              (图6)

 

八:选择需要Import excel文件,File Origin 默认选项(如图7

                                          (图7)

  

九:点击next后如图,俺默认,可根据实际情况自己来选择(如图8

                               (图8)

十: 点击Next 后如下图,选择默认(如图9

                                      (图9)

 

十一:点击Next 后如下图,选择默认(如图10

                                       (图10)

十二:点击Next 后如下图,选择默认(如图11

                                  (图11)

十三:点击Next 后进入如下图,点击Excute(如图12

                                   (图12)

十四:点击Next 后进入如下图,选择第一项(如图13

                                     (图13)

十五:点击OK 后如下图(图14),导入结束

                                    (图14)

 

 

 

十六: 在Oracle里查询一下: 

 

scott@NIUGE> select * from test;

     ID_NO ID_NO1 ID_NO2 ID_NO3 ID_NO4 ID_NO5
---------- ---------- ---------- ---------- ---------- ----------

         0 0 0 0 0 0
         1 1 1 1 1 1
         2 2 2 2 2 2
         3 3 3 3 3 3
         4 4 4 4 4 4
         5 5 5 5 5 5
         6 6 6 6 6 6

7 rows selected.

阅读(2753) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

fly-lin2008-06-28 08:54:36

Tab index out of bounds 我在导入时遇到此种情况,请帮忙解决一下