Invalid syntax for integer

Поиск
Список
Период
Сортировка
От Rehan Saleem
Тема Invalid syntax for integer
Дата
Msg-id 1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com
обсуждение исходный текст
Ответы Re: Invalid syntax for integer  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-sql
hi ,

what is wrong with this if statement in this function

if distance ='' THEN
    distance := 1;
    end if;
here distance variable is of type integer , this function has been created successfully but when i execute this function it gives me this error ,

ERROR:  invalid input syntax for integer: ""
LINE 1: SELECT distance =''
                                ^
QUERY:  SELECT distance =''
CONTEXT:  PL/pgSQL function "getsitesbytfid" line 6 at IF

********** Error **********

ERROR: invalid input syntax for integer: ""
SQL state: 22P02
Context: PL/pgSQL function "getsitesbytfid" line 6 at IF


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: crosstab
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: Invalid syntax for integer