Re: a stored procedure ..with integer as the parameter

From: Richard Huxton <dev(at)archonet(dot)com>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: a stored procedure ..with integer as the parameter
Date: 2005-10-24 09:34:25
Message-ID: 435CAAA1.8070906@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

surabhi.ahuja wrote:
> from the client I get : "200", "surabhi", "10"
> now i have to make a call to the stored procedure using the above received strings.
> will not the "200" be converted to a valid integer before saving into the database ..and same with the smallint values.

That wasn't the error you reported. You reported a problem with storing
"" which not only isn't a number, it isn't even text. Double-quoting
indicates it's a name (i.e. an identifier - a table name or similar).

So - this suggests some questions:
1. Do you know what data-types the client is providing?
2. What validation/checking do you do on the client-supplied data?
3. How are you building your query - via Perl's DBI system, PHP's
PEAR:DB classes, JDBC?

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message talenat 2005-10-24 10:07:41 Re: Collate problem
Previous Message Martijn van Oosterhout 2005-10-24 09:33:50 Re: SHA1 authentication