Re: BUG #3590: Error while in Plpgsql :

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #3590: Error while in Plpgsql :
Дата
Msg-id 23219.1188568817@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #3590: Error while in Plpgsql :  ("Abdus Samad Ansari" <abdus.samad.ansari@gmail.com>)
Список pgsql-bugs
"Abdus Samad Ansari" <abdus.samad.ansari@gmail.com> writes:
> I am using a plpgsql function and in this I am issuing a insert as :
> Insert into pis.hrt_emp_leave_bin
> (emp_no,leave_cd,curr_dt,bin_sl_no,cal_yr,tran_typ,open_bal,ytd_availed,avai
> led) values (EmployeeNumber, LeaveCode, CurrentDate,
> Bin_Serial_No,to_number(to_char(CurrentDate,''YYYY''),''9999''),''CM'',
> OpenBal,YtdAvailed+LeaveVal,LeaveVal);

> This insert statement while run give an error message :
> ERROR:  syntax error at or near "$1" at character 35

This probably means that one of the field names in the statement (if I
counted characters right, probably "emp_no") is the same as the name of
one of the plpgsql variables in the function.  You need to change the
variables to not conflict with any of the table or field names you need
to reference in the queries of that function, because plpgsql is not
very bright about telling when it should substitute and when it should
not.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Josh Tolley"
Дата:
Сообщение: Re: to_date gives odd results
Следующее
От: "Ben Kim"
Дата:
Сообщение: BUG #3591: autovacuum crash