X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C05E3D1DD2C for ; Tue, 13 Apr 2004 16:06:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 53445-02 for ; Tue, 13 Apr 2004 16:06:32 -0300 (ADT) Received: from web20810.mail.yahoo.com (web20810.mail.yahoo.com [216.136.226.199]) by svr1.postgresql.org (Postfix) with SMTP id A5FF9D1DC7D for ; Tue, 13 Apr 2004 16:06:30 -0300 (ADT) Message-ID: <20040413190631.66197.qmail@web20810.mail.yahoo.com> Received: from [24.248.12.72] by web20810.mail.yahoo.com via HTTP; Tue, 13 Apr 2004 12:06:31 PDT Date: Tue, 13 Apr 2004 12:06:31 -0700 (PDT) From: Jeff Eckermann Subject: Re: parameter to db function To: Sheeraz fazal Cc: pgsql-odbc@postgresql.org In-Reply-To: <00f801c42175$ae9f6b30$d903a8c0@glowtek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/96 X-Sequence-Number: 3991 --- Sheeraz fazal wrote: > Thanks Jeff. > Can you tell me if i have to pass parameters to a db > function let's say it's > name is > > get_square(integer) > > It returns square of a number. What will be the > syntax of the ODBC call to > invoke this function, and > how you will specify the place holder for the > returned value. I don't do ODBC calls ;-) Exactly how you handle this depends on your choice of language and data access library. In general: you want to send a SQL string "SELECT get_square(integer_value)", where "integer_value" is determined at run time. What you get back will be a result set with one row and one column. If you want to refer to the column by name, you can specify a name by adding the alias "AS my_column_name" to the SQL string. The rest you can get from the documentation for your environment, particulary about how SQL queries and result sets are handled. > > Thanks. > > ----- Original Message ----- > From: "Jeff Eckermann" > To: "Sheeraz fazal" ; > > Sent: Tuesday, April 13, 2004 7:43 AM > Subject: Re: [ODBC] parameter to db function > > > > --- Sheeraz fazal wrote: > > > Hi, > > > > > > Is it allowed to pass parameters to a db > function > > > through ODBC? > > > > Yes. Just capture the values in your application, > > then construct a query string and send it to the > > server. > > > > > > > > Thanks. > > > > > > > > > > > > ---------------------------(end of > > > broadcast)--------------------------- > > > TIP 7: don't forget to increase your free space > map > > settings > > > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! Small Business $15K Web Design Giveaway > > http://promotions.yahoo.com/design_giveaway/ > > > > ---------------------------(end of > broadcast)--------------------------- > > TIP 5: Have you checked our extensive FAQ? > > > > > http://www.postgresql.org/docs/faqs/FAQ.html > > > > > __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html