Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend Studio - Data Quality - regular expression error within a built-in sql script

The following sql script works correctly in MySQL workbench however when I copy this sql script into an tmysqlinput built-in component in a Talend job the script is changed by Talend when I run it.

 

The original script is:

SELECT
name_sur
,regexp_substr (name_sur,'\\S*Admin+') as new_field2

FROM debtrecovery.bailiff
where name_sur like '%Admin%'

 

whereas the amended version is:

 

SELECT
name_sur
,regexp_substr (name_sur,'S*Admin+') as new_field2

FROM debtrecovery.bailiff
where name_sur like '%Admin%'

 

Talend is removing the two backslashes in front of the capital S i.e.

 

original regex:   '\\S*Admin+'

amended regex: 'S*Admin+'

This is amending my final output, giving me incorrect data.

 

Is this a known bug or is there any specific work around I can use.

 

Thanks

Kevin

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello,

Are you trying to write 4 backslashes in your sql script to see if your final output correct?

Best regards

Sabrina

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hello,

Could you please clarify in which Talend version/edition you are?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabrina,



Thanks for looking into this issue for me. The version that I am using is Talend 6.4.1



Regards,



Kevin

Anonymous
Not applicable
Author

Hello,

Are you trying to write 4 backslashes in your sql script to see if your final output correct?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabrina,

 

It was an escape char issue so thanks for your suggestion. This works fine now

 

Regards,

 

Kevin