โ03-07-2019 12:28 PM
Dear Snaplogic Community
I am calling an SQL Server Execute to return the field value of โCLI_SUR_NMโ i.e. surname in the table based on a โ$FinalIngenPolicyNoโ primary key fed by a mapper. If the ID primary key is not found then how do I trap this scenario in the snaplogic snaps? What is a good way to deal with no results from an sql execute snap? If it returns no results and i map the โ$CLI_SUR_NMโ value I get an error.
Thank you very much!
โ03-08-2019 07:13 AM
Do you have the โPass Throughโ option checked in the Execute snaps properties? Can you share the full configuration for the Execute snap.
Also, I wanted to mention that I donโt think you need to make the SQL Statement an expression. I think you should be able to write the last bit as follows:
CFPOL.POL_ID = $FinalIngenPolicyNo;
The snap should substitute references like that automatically.
โ03-08-2019 07:43 AM
Hi Tim
Thanks for the reply. Yes I do have โPass Trhoughโ checked as seen below in the screenshot. If it returns nothing whatโs the best way to handle this? Thanks
Noted on not make the SQL Statement an expression
Thank you!
โ03-08-2019 09:21 AM
In your first post, the screenshot shows the Execute snap not generating any preview documents. But, you donโt have โExecute during previewโ checked for the snap, so it wonโt running during validation/preview. Can you select that and try again?
โ03-08-2019 10:36 AM
Hi Tim
I selected execute during preview now. And only the original passes through. I want to write logic to do processing when no rows are returned from sql server execute e.g. using the router below.
Below is the original string which is returned when the primary key is not found.