| От | Stephan Szabo |
|---|---|
| Тема | Re: a stored procedure ..with integer as the parameter |
| Дата | |
| Msg-id | 20051020233951.A7227@megazone.bigpanda.com обсуждение исходный текст |
| Ответ на | a stored procedure ..with integer as the parameter ("surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in>) |
| Список | pgsql-general |
On Fri, 21 Oct 2005, surabhi.ahuja wrote:
> i have a stored procedure
>
> insert_table(integer)
> which does "insert into table (x) value ($1)";
>
> now in my client i call the stored procedure as
>
> select insert_table("3");
>
> it works fine and inserts 3 into the table
>
> but suppose i give
>
> select insert_table("");
>
> it gives an error ...saying " invalid input syntax for integer: "
>
> please suggest a solution to this problem
Don't try to use an empty string as an integer?
Seriously, you need to give information about what you want to happen,
because an empty string isn't a valid integer and can't really be
converted into one (we explicitly removed code that handled this case
because we thought it didn't make sense).
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера