<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Error handling when using SQL DDL for Smart Data Integration in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaa-p/12297243#M4608828</link>
    <description>&lt;P&gt;Your observation is correct - the SQL Script error handler catches SQL errors and nothing else.&lt;/P&gt;&lt;P&gt;Errors from remote sources are not caught by it. To create a fault-tolerant solution for your use case, I guess the easiest way is to &lt;STRONG&gt;not&lt;/STRONG&gt; do it in SQL Script but in one of the programming languages that support the HANA client libraries.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 22:42:59 GMT</pubDate>
    <dc:creator>lbreddemann</dc:creator>
    <dc:date>2020-11-04T22:42:59Z</dc:date>
    <item>
      <title>Error handling when using SQL DDL for Smart Data Integration</title>
      <link>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaq-p/12297242</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
  &lt;P&gt;it seems to be a problem to catch errors on SDI-SQL? &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;
CREATE or replace  PROCEDURE test  --IN NAME NVARCHAR(1000)
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER AS
BEGIN
   DECLARE s nvarchar(1000);
   DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
	BEGIN 
		select ::SQL_ERROR_CODE, ::SQL_ERROR_MESSAGE  from dummy;
	END;
	
	--select 1/0 from dummy; --This error is handled fine (if not commented out)
	s='CREATE VIRTUAL TABLE "test" at "REMOTE_SOURCE_EXCEL"."&amp;lt;NULL&amp;gt;"."&amp;lt;NULL&amp;gt;"."MyExcel.xls/worksheet1"';
	exec :s; -- Error  is NOT catched! procedure crashes
END;

CALL test;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The creation of the virtual table usually succeeds, if everything is declared properly. But what about an error condition?&lt;/P&gt;
  &lt;P&gt;If probably the remote file is not available, the error handler has no effect:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The error was NOT Catched, the procedure crashes.&lt;/P&gt;
  &lt;P&gt;Does anybody have an idea how to enable error handling here?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 22:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaq-p/12297242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-11-04T22:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling when using SQL DDL for Smart Data Integration</title>
      <link>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaa-p/12297243#M4608828</link>
      <description>&lt;P&gt;Your observation is correct - the SQL Script error handler catches SQL errors and nothing else.&lt;/P&gt;&lt;P&gt;Errors from remote sources are not caught by it. To create a fault-tolerant solution for your use case, I guess the easiest way is to &lt;STRONG&gt;not&lt;/STRONG&gt; do it in SQL Script but in one of the programming languages that support the HANA client libraries.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 22:42:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaa-p/12297243#M4608828</guid>
      <dc:creator>lbreddemann</dc:creator>
      <dc:date>2020-11-04T22:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling when using SQL DDL for Smart Data Integration</title>
      <link>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaa-p/12297244#M4608829</link>
      <description>&lt;P&gt;Hm, but a create-virtual-table is a SQL error. So it should, shouldn't it? I would raise a ticket with SAP.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 06:32:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-handling-when-using-sql-ddl-for-smart-data-integration/qaa-p/12297244#M4608829</guid>
      <dc:creator>werner_daehn</dc:creator>
      <dc:date>2020-11-05T06:32:46Z</dc:date>
    </item>
  </channel>
</rss>

