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.  

  • 0
    点赞
  • 0
    收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论 1
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值