How to make it working?

Database
Enthusiast

How to make it working?

Hi,
I am trying to create a procedure as below:

REPLACE PROCEDURE ECR_ANALYTICS_U2.sp1()
BEGIN
DECLARE customer_gci_var CHAR(9);
DECLARE ACRE_comb_cur CURSOR FOR
SELECT customer_gci FROM ECR_ANALYTICS_U2.ACRE_combined_FAN
FOR UPDATE;
OPEN ACRE_comb_cur;
FETCH ACRE_comb_cur INTO customer_gci_var;
CLOSE ACRE_comb_cur;
END;

When I compile it, I always got error:
SPL1120:E(L9), Updatable cursors not allowed in Teradata session mode.

How to modify the definition to make the updatable cursor working?
I'll appreciate your help.
1 REPLY
rgs
Enthusiast

Re: How to make it working?

From the error message document:

SPL1120: "%s:E(L%d), Updatable cursor is not
allowed in Teradata mode."

Explanation: If a stored procedure is being created in
Teradata (BTET) mode, the ANSI mode-specific updatable
cursor statement cannot be specified in the SPL
source text.

Generated By: TSP module.

For Whom: End user.

Remedy: Remove the ANSI mode-specific updatable
cursor statement or change the session mode to ANSI
before creating the procedure.