I'm struggling with how to make plpgsql iterate through a list of numbers input as a text string, eg. "1438 2656 973 4208". I figure that I can use the regexp_split_to_array() function to make an array of the string, but can I iterate through an array with eg. a FOR loop? regards, -- Leif Biberg Kristensen http://solumslekt.org/
On 2010-03-25, Leif Biberg Kristensen <leif@solumslekt.org> wrote: > I'm struggling with how to make plpgsql iterate through a list of numbers > input as a text string, eg. "1438 2656 973 4208". I figure that I can use the > regexp_split_to_array() function to make an array of the string, but can I > iterate through an array with eg. a FOR loop? using regex_split_to_table with for is easier for x in regex_split_to_table(....) do But if you must you can use split to array and then use the array measuring functions to determine the limit for a counted for loop.
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера