The positional assignment list has too few values

Database
Teradata Employee

The positional assignment list has too few values

Hi

 

I have compiled my procedure successfully, but when I call the procedure it gives me error 'The positional assignment list has too few values'

 

This is my Procedure:

REPLACE PROCEDURE DWD09P_APP_EHR.FromProgressArray (INOUT V_ARRAY VARCHAR(4000), IN V_delimiter CHAR(1), IN V_INDEX INTEGER, OUT V_RETURN VARCHAR(4000))SQL SECURITY OWNER
BEGIN

   DECLARE V_counter INTEGER DEFAULT 0;
   
   if V_INDEX = 0 THEN
    SET V_RETURN = SUBSTR(V_ARRAY, 1, INDEX(V_ARRAY, V_delimiter) - 1);
   END if;
   
   while V_counter < V_index
    DO
        if index(V_array, v_delimiter) <> 0 THEN
            select substr(v_array, index(v_array, v_delimiter) + 1, LENGTH(v_array)) into v_array;
        else
            set V_array = NULL ;
        END IF;
            set v_counter = V_counter + 1;
    END WHILE;
    
        if index(V_array, V_delimiter) <> 0 then
    select SUBSTR(V_array, 1, index(V_array, V_delimiter) - 1) into V_array;
    END IF;

    SET V_RETURN = V_array;
END;

 

My call statment is : 

call DWD09P_APP_EHR.FromProgressArray('asdasde','d',1)

 

Any idea, why it is giving the error. I have given 3 Input.

 

Thanks

Akshat

1 REPLY
Senior Apprentice

Re: The positional assignment list has too few values

Well, you defined 4 parameters including the OUT:

 

call DWD09P_APP_EHR.FromProgressArray('asdasde','d',1, v_return)

 

But what is this SP supposed to do?

Looks like a self-made variation of STRTOK('asdasde', 'd', 2)