| От | Chris Ochs |
|---|---|
| Тема | casting parameters to a function |
| Дата | |
| Msg-id | 039101c3da2d$b87d78c0$250a8b0a@chris обсуждение исходный текст |
| Ответы |
Re: casting parameters to a function
|
| Список | pgsql-general |
I am trying to move all of the sql statements from my code into a pl/pgsql function. I have one function for a transaction block that contains 10 inserts and I need to pass 50 parameters to it. Well I can't do that, so I was playing around with passing the parameters in as a varchar[] array, but then I have the issue of the variables being the wrong type when I insert them. I was playing around with trying to convert types, but it isn't working so far. The function takes a single varchar[] as an argument.. This doesn't work: s ALIAS FOR $1; in_trans_date timestamp := s[3]; and this doesn't work either: in_trans_date timestamp := $1[3]; Can someone help me in how to assign an array element to a variable and cast it?
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера