Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III

How to change nls_sort in tOracle_Output component.

In same Database, I use a tOracle_Input component to select rows in table with a comand like 'select * from table'. Then I use a tMap component without doing any transformation. And, so I use a tOracle_Output component to insert or update other table with input data. The input and output tables are identical and have a Primary Key with datatype varchar2. The problem is: when the tOracle_Output component works to insert or update the row, it sends a comand to database with a convert clause like 'filter(NLSSORT("IG",'nls_sort=''WEST_EUROPEAN''')=NLSSORT(:1,'nls_sort=''WEST_EUROPEAN'''))'. This clause avoid the use of index, which forces the database to make a full table scan.
As I'm talking about the same database, and then, I'm talking about the same 'nls_sort', I think that, when the tOracle_Input component gets the rows, then it also converts to a nls_sort 'WEST_EUROPEAN'. If I can change the default nls_sort of the talend or its component, I can solve the performance problem. Do you have any other suggestions ? How can I change the nls_sort default of the talend or its component ?
Regards,
Marcio.
Labels (2)
5 Replies
Anonymous
Not applicable

You can set this parameter for the connection. I would recommend using one connection for all database components within a job and at first using tOracleRow to set the nls_sort parameter (sorry, I don't how, but I know there are a SQL command to do that).
tOracleConnection -> OnSubjobOk -> tOracleRow (changing the connection parameter) -> OnSubjobOk -> your work to do....
_AnonymousUser
Specialist III
Author

_________________________________________________________________________
You can set this parameter for the connection. I would recommend using one connection for all database components within a job and at first using tOracleRow to set the nls_sort parameter (sorry, I don't how, but I know there are a SQL command to do that).
tOracleConnection -> OnSubjobOk -> tOracleRow (changing the connection parameter) -> OnSubjobOk -> your work to do....
Last edited by jlolling (Yesterday 15:59:21)
Talend Certified working for cimt objects AG in Berlin
_________________________________________________________________________
I tried to make this but, it didn´t work. First I need to have 2 connection, 1 for input and other to output, because of the grant of each user connections in each table, of each schema. I have same database but, differents schemas and tables.
So, I tried with: tOracleConnection (for tOracleOutput) -> OnSubjobOk -> tOracleRow (alter session set nls_sort='BINARY') -> OnSubjobOk -> tOracleConnection (for tOracleInput) -> OnSubjobOk -> tOracleRow (alter session set nls_sort='BINARY') -> tOracleInput (for input data) -> tMap -> tOracleOutput.
Seeing the Oracle database I found the sql insert command and its execution plan with the clause :
filter(NLSSORT("IG",'nls_sort=''WEST_EUROPEAN''')=NLSSORT(:1,'nls_sort=''WEST_EUROPEAN''')), although I have put 'NLS_SORT=Binary', with a 'index full scan' using the primary key with datatype varchar2(9). It causes a bad performance.
Any suggestions ?
Anonymous
Not applicable

I cannot imagine why the tOracleOutput component should create this kind of statements.
In the code of the tOracleOutput component there is no sql code like this.
Can you please post the picture of your job and the properties of the tOracleOutput component?
_AnonymousUser
Specialist III
Author

Hi, I uploaded the picture of my job in:
https://plus.google.com/photos/115901751524062895350/albums/5833268675260405105
I think it happens when the tOracleOutput component makes connection with the Oracle database. Perhaps the component tOracleOutput may had changed the nlssort parameter of the session that has been opened.
_AnonymousUser
Specialist III
Author

I think the problema is:
When I do the follow command in other than TOS (like sqlplus/toad/sqltools):
"select * from nls_session_parameters;"
I get this result:
PARAMETER VALUE
------------------------------ ---------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT dd/mm/yyyy
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
When I do the follow command in TOS:
"select * from nls_session_parameters"
I get other result:
NLS_LANGUAGE BRAZILIAN PORTUGUESE
NLS_TERRITORY BRAZIL
NLS_CURRENCY R$
NLS_ISO_CURRENCY BRAZIL
NLS_NUMERIC_CHARACTERS ,.
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD/MM/RR
NLS_DATE_LANGUAGE BRAZILIAN PORTUGUESE
NLS_SORT WEST_EUROPEAN
NLS_TIME_FORMAT HH24:MI 0683p000009M9p6.pngSXFF
NLS_TIMESTAMP_FORMAT DD/MM/RR HH24:MI 0683p000009M9p6.pngSXFF
NLS_TIME_TZ_FORMAT HH24:MI 0683p000009M9p6.pngSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD/MM/RR HH24:MI 0683p000009M9p6.pngSXFF TZR
NLS_DUAL_CURRENCY Cr$
NLS_COMP ANSI
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
The nls_comp and nls_sort parameter are not the same. So Oracle DB does 'full table scan'.
Can you help with : How can I change it in oracle connections in TOS ?