首页 > 代码库 > Powercenter Source Filter
Powercenter Source Filter
Source Qualifier Transformation > Entering a Source Filter
Entering a Source Filter
You can enter a source filter to reduce the number of rows the Integration Service queries. If you include the string ‘WHERE‘ or large objects in the source filter, the Integration Service fails the session.
The Source Qualifier transformation includes source filters in the default SQL query. If, however, you modify the default query after adding a source filter, the Integration Service uses only the query defined in the SQL query portion of the Source Qualifier transformation.
You can use a parameter or variable as the source filter or include parameters and variables within the source filter. When including a string mapping parameter or variable, use a string identifier appropriate to the source system. For most databases, you need to enclose the name of a string parameter or variable in single quotes.
When you include a datetime parameter or variable, you might need to change the date format to match the format used by the source. The Integration Service converts a datetime parameter and variable to a string based on the source system.
Note: When you enter a source filter in the session properties, you override the customized SQL query in the Source Qualifier transformation.
To enter a source filter:
1. | In the Mapping Designer, open a Source Qualifier transformation. The Edit Transformations dialog box appears. |
2. | Select the Properties tab. |
3. | Click the Open button in the Source Filter field. |
4. | In the SQL Editor dialog box, enter the filter. Include the table name and port name. Do not include the keyword WHERE in the filter. Enclose string mapping parameters and variables in string identifiers. Alter the date format for datetime mapping parameters and variables when necessary. |
5. | Click OK. |
Informatica Corporation |
http://mysupport.informatica.com |
1,
2,进行一个过滤,相当于添加where条件;
测试结果:
3,如果修改了default query,既修改了SQL Query里面的内容,IS仅使用SQL Query里面的内容。既Source Filter失效。
查询结果:
4,如果是在session level添加了source qualifier,那么会覆盖在mapping中的sql overwide.
5,添加parameters或者variables相当于添加where条件,假设新加这样一个内容:$$countryID=‘CA‘,那么执行worklow后的日志是这样.
错误日志:
Severity: ERROR
Timestamp: 28/10/2014 6:02:31 PM
Node: node01_ifop_app615_test
Thread: READER_1_1_1
Process ID: 2014
Message Code: RR_4035
Message: SQL Error [
ORA-00936: missing expression
Database driver error...
Function Name : Execute
SQL Stmt : SELECT COUNTRIES.COUNTRY_ID, COUNTRIES.COUNTRY_NAME, COUNTRIES.REGION_ID FROM COUNTRIES WHERE =‘CA‘
Oracle Fatal Error
Database driver error...
Function Name : Execute
SQL Stmt : SELECT COUNTRIES.COUNTRY_ID, COUNTRIES.COUNTRY_NAME, COUNTRIES.REGION_ID FROM COUNTRIES WHERE =‘CA‘
Oracle Fatal Error].
以上既可说明它是新加where条件。
Powercenter Source Filter