Data Management Platform: tSQLTemplate ignores SQl exception

Two Stars

Data Management Platform: tSQLTemplate ignores SQl exception

Hello,

 

I am working on an ETL job that executes some custom T-SQL code in a tSQLTemplate component. Part of this custom T-SQL code is to check for missing table entries, and throw an exception using "throw 52015, @message,1;" to trigger an exception if certain entries are missing. This exception is then to be shown in the Talend console.

While this approach has worked using Talend 5.6.2, after migrating to Talend 7.1.0, the exception is not reliably shown in the console. To be precise, it only shows if the custom T-SQL code starts with "throw 52015, @message,1;". If this statement is preceded with any other statements, the exception seems to be ignored by Talend.

The T-SQL code I want to use is like:

 

declare @msg varchar(255);
select top 1 @msg = 'lnk: at least one missing hub seq for table stg'
from stg.stage_table stg
where
(   
      not exists (select 1 from cdw.hub_table1 b
                    where b.bk_id = stg.bk_id1
                 )
   or not exists (select 1 from cdw.hub_table2 c
                    where c.bk_id = stg.bk_id2
                 )
);

if @msg like 'lnk: at least one missing hub seq for%'
throw 52015, @msg, 1
;

Thanks,

Martin

 

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog