Skip to main content

#Global0 discussing

Hi,

Recently I added try ...Catch statement in my stored procedure and I noticed after adding the statement tableau always returns empty table.

Does tableau have issue with try...catch statement being used in Stored Procedure?

 

Thanks

Kartik

20 answers
  1. May 15, 2020, 8:34 AM

    Happily, I can confirm that I am able to use a try...catch sproc with Tableau with no problem, so this might not be a problem with either Tableau or the driver Tableau is using:

     

    I have a copy of Superstore deployed to a db - this is unmodified and original (no tuning etc):

    The try...catch I am using will return exactly the same result, we are not testing the correct functionality here, just whether Tableau is able to consume the result-set of a query that contains the try...catch:

     

    Happily, I can confirm that I am able to use a try...

    pastedImage_1.png

     

    pastedImage_2.png

    pastedImage_3.png

     

    So with the above result, in my case with this simple try...catch, Tableau is not experiencing problems with consuming the result, hence why I suspect the problem to lie elsewhere rather than with either Tableau or the Tableau to SQL Server driver; we can still try to help you resolve the problem nonetheless.

     

    So lets take a look at that query: what happens in the try..catch, does it try to resolve the error, or does it simply halt execution returning the error code?

     

    Using Superstore as your guide, please can you replicate the results, so assuming the query executes without error, then the entirety of superstore will be returned, but, if the catch is activated, what is returned?

     

    Steve

0/9000