Importing a Microsoft Excel Source Definition
2015-08-21 16:01
453 查看
Importing a Microsoft Excel Source Definition
#PowerCenter treats a Microsoft Excel source as a relational database, not a flat file. Likerelational sources, the Designer uses ODBC to import a Microsoft Excel source. You do not need database permissions to import Microsoft Excel sources.
#Complete the following tasks before you import an Excel source definition:
#
1. | # Install the Microsoft Excel ODBC driver on the system. |
2. | # Create a Microsoft Excel ODBC data source for each source file in the ODBC Data Source Administrator. |
3. | # Prepare Microsoft Excel spreadsheets by defining ranges and formatting columns of numeric data. |
Defining Ranges
##The Designer creates source definitions based on ranges you define in Microsoft Excel. You
can define one or more ranges in a Microsoft Excel sheet. If you have multiple sheets, define at least one range for each sheet. When you import sources in the Designer, each range displays as a relational source.
#You must define a range in the Designer to import the Excel source definition.
To define a range:
1. | # Open the Microsoft Excel file. |
2. | # Highlight the column or group of columns of data to import. |
3. | # Click Insert > Name > Define. |
4. | # Enter a name for the selected range and click OK. |
5. | # If you have multiple sheets, select each sheet and repeat steps 2 to 4 to define ranges for each set of data. |
6. | # Click File > Save. |
#
Formatting Columns of Numeric Data
##In Microsoft Excel, you can assign datatypes to columns of data. The Microsoft Excel datatypes
are ODBC datatypes. PowerCenter supports ODBC datatypes and converts them to transformation datatypes. If you do not assign datatypes in Microsoft Excel, the Designer imports each column as VARCHAR. If you want to perform numeric or aggregate calculations
in a mapping, assign numeric datatypes in Microsoft Excel before importing the spreadsheet.
To format columns in Microsoft Excel:
1. | # Open the Microsoft Excel file. |
2. | # Select the columns of data that consist of numeric data. |
3. | # Click Format > Cells. |
4. | # In the Number tab, select Number. |
5. | # Specify the number of decimal places. |
6. | # Click OK. |
7. | # Click File > Save. |
#
Steps to Import a Microsoft Excel Source Definition
##After you define ranges and format cells, you can import the ranges in the Designer. Ranges
display as source definitions when you import the source.
To import a Microsoft Excel source definition:
1. | # In the Designer, connect to the repository and open the folder for the source definition. |
2. | # Open the Source Analyzer and click Sources > Import from Database. |
3. | # Select Excel Files (Microsoft Excel Driver (*.xls)) for the data source. |
4. | # Click the Browse button to open the ODBC Administrator. |
5. | # In the User or System DSN tabs, depending on where you created the data source, double-click the Microsoft Excel driver. |
6. | # Click Select Workbook and browse for the Microsoft Excel file, which is considered a relational database. |
7. | # Click OK three times to return to the Import Tables dialog box. |
8. | # Click Connect in the Import Tables dialog box. #You do not need to enter a database user name and password. The ranges you defined in the Microsoft Excel file appear as table names. The database owner is No Owner because you are not required to enter a database user name. |
9. | # Select the table you want to import. #To select more than one table, hold down the Ctrl or Shift keys to highlight multiple tables. |
10. | # Click OK. #In the Navigator, the source definition appears in the Sources node, under the database name. |
相关文章推荐
- Android 点击两次返回退出应用
- 寒冰王座
- mac系统使用技巧链接汇总
- 文章标题
- GDI+画电子印章
- 剑指off-判断5张牌是否是顺子
- WPF 自定义控件依赖属性怎么实时变化?
- 利用mod_wsgi部署Django应用
- C#获取网络图片显示到picturebox
- Linux 查看文件和文件夹大小
- 电赛总结(四)——波形发生芯片总结之AD9834
- php-fpm 启动参数及重要配置详解
- c#用户控件的生命周期
- 莫比乌斯函数
- android 组件DatePicker实例
- UVA---10608-Friends(并查集)
- String,创建对象问题
- 2.DB-Mysql++实例
- 编程方法论/架构设计/模式相关转载链接汇总
- 背景填充全屏