Обсуждение: How to pass same index array value from multiple arrays?

Поиск
Список
Период
Сортировка

How to pass same index array value from multiple arrays?

От
Sarit Ritwirune
Дата:
Hi

I posted my question on the forum, but seems nobody pay attention that much.
http://dba.stackexchange.com/questions/111410/call-ordered-element-from-foreach-on-multiple-arrays

In PLPGSQL. Can FOREACH loop over the multiple array?. <br>
In my case 3 arrays dimention are identical.<br>
How can I pass the elements of them like
   for(int i = 0 ; i < array1.length ; i++){     my_method(array1[i], array2[i], array3[i]);   }

Here is my attempt.
   NOTICE:  The transaction is in an uncommitable state.Transaction was rolled back.   NOTICE:  query "SELECT
QuestionList,UserResponseID_List, UserResponseList" returned 3 columns 42601   ERROR:  cannot begin/end transactions in
PL/pgSQL  HINT:  Use a BEGIN block with an EXCEPTION clause instead.   CONTEXT:  PL/pgSQL function
dugong.session_hugeinsert(integer,text,text)line 38 at SQL statement 

How can I pass values like ordinary procedural language line C/C++, Java, etc.
Best regards
Sarit