SSC-EWI-TD0034

Multistatement SQL is not supported.

Some parts in the output code are omitted for clarity reasons.

Severity

Low

Description

Multistatement SQL execution is not supported. The request was handled as a transaction.

The following EWI is only generated when the PL Target Language flag is set to Javascript, like this: '--PLTargetLanguage Javascript'

Example Code

Input:

IN -> Teradata_01.sql
-- Additional Params: --PLTargetLanguage Javascript
REPLACE PROCEDURE proc1()
  BEGIN
    BEGIN REQUEST;
      SELECT* FROM TABLE1;
    END REQUEST;
END;

Output:

OUT -> Teradata_01.sql
CREATE OR REPLACE PROCEDURE proc1 ()
RETURNS STRING
LANGUAGE JAVASCRIPT
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
EXECUTE AS CALLER
AS
$$
  // SnowConvert Helpers Code section is omitted.

  var TRANSACTION_HANDLER = function (error) {
    throw error;
  };
  // ** SSC-EWI-TD0034 - MULTISTATEMENT SQL EXECUTION NOT SUPPORTED, REQUEST HANDLED AS TRANSACTION **
  try {
    EXEC(`BEGIN`);
    EXEC(`SELECT
   *
FROM
   TABLE1`,[],undefined,TRANSACTION_HANDLER);
    EXEC(`COMMIT`);
  } catch(error) {
    EXEC(`ROLLBACK`);
  }
$$;

Recommendations

Last updated