a stored procedure ..with integer as the parameter

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: <pgsql-general(at)postgresql(dot)org>
Subject: a stored procedure ..with integer as the parameter
Date: 2005-10-21 06:03:54
Message-ID: 967CFC4343BF2A4DAFACD026D33DC85118EC7F@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

thanks,
reagrds
surabhi

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2005-10-21 06:41:54 Re: a stored procedure ..with integer as the parameter
Previous Message Jeff Davis 2005-10-21 05:58:48 Re: [GENERAL] Oracle buys Innobase