Excel File to Oracle data.

Excel File to Oracle data.

Follow  these steps

 Excel -> CSV -> Oracle

   1.Save the Excel spreadsheet as file type 'CSV' (Comma-Separated
Values).
   2.Transfer the .csv file to the Oracle server (usually HP Unix).
   3.Create the Oracle table, using the SQL CREATE TABLE statement to
define the table's column lengths and types. Here's an example of an
sqlplus 'CREATE
     TABLE' statement:

     CREATE TABLE T_ACCT 
      (acct_id VARCHAR2(18),
       balance NUMBER(13),
       prepay number(13));

   4.Use sqlload to load the .csv file into the Oracle table. Create a
sqlload control file like this:

     load data
     infile T_ACCT.csv
     replace
     into table T_ACCT 
     fields terminated by ','
     (acct_id,balance,prepay)

   5.Invoke sqlload to read the .csv file into the new table, creating one
row in the table for each line in the .csv file. This is done as a Unix
command:

      % sqlload userid=username/password control=<filename.ctl>
log=<filename>.log

     This will create a log file <filename>.log. Check it for loading
errors.
   6.Use these sqlplus commands to check the Oracle table:

      DESCRIBE T_ACCT;
      SELECT COUNT(*) FROM  T_ACCT ;
      SELECT * FROM  T_ACCT  WHERE ROWNUM <5;

   7.You're done.  

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值