Error T3932

UDA
Max
Enthusiast

Error T3932

Hello.

I have a store ptocedure that works well when i launch it from teradata.
When i launch it from Data Stage returns this SQLCODE = T3932.

The code of Store Procedure is :

REPLACE PROCEDURE DOL.LOAD_STATISTICS (OUT STAT_SCRITTE INTEGER, OUT COD_RIT VARCHAR(5))

BEGIN
DECLARE N_STATISTICHE INTEGER DEFAULT 0;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SET STAT_SCRITTE = 0;
SET COD_RIT = SQLSTATE;
END;

SET N_STATISTICHE = 0;

COLLECT STATISTICS DOL_DM.DOL_FAT_TDD_ARMAX INDEX
(ID_GIORNO, ID_TIPOPUNTUAL, ID_MODGESTIONE,ID_FASCIAORARIA,ID_ITINER);

SET N_STATISTICHE = N_STATISTICHE +1;
SET STAT_SCRITTE = N_STATISTICHE;
SET COD_RIT = 0;

END;

I read
(Teradata RDBMS - SQL Reference - Stored Procedures and Embedded SQL)
about that error, but I have not understood how fix the problem.

Any Help will be appreciated.

Thanks in advance Massimiliano

2 REPLIES
Enthusiast

Re: Error T3932


putting a

ET;BT;

after the collect statistics command would most likely fix the issue, but I wouldn't recommend that. The best approach would be to make sure that Data Stage is not calling the SP as part of a transaction (if you achieve it some how) or to make DS launch a bteq script (which has the call to the SP) once the DS job is finished. (I have seen the later approach in a few places in the past, though it would have only some simple collect stats commands... do you really need a proc to do this ?? )

Good luck !
Max
Enthusiast

Re: Error T3932

Thanks joedisilva.

Your first suggestion has worked well.

I have spoken with the DS user about your's last two suggestions, but it has not know to say me nothing about the first.
About the last i tried to built a macro with one collect statistics statement and it chek ok in teradata, but ds user does not succeed to launch it.

So i think that BT;ET statment is the best way form me :-)

Thank again.