X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3B4CC9DC81B for ; Sun, 8 Jan 2006 18:16:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95817-09 for ; Sun, 8 Jan 2006 18:16:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from gk-us2.us.michelin.com (gk-us2.michelin.com [156.65.14.19]) by postgresql.org (Postfix) with ESMTP id D3CCB9DC834 for ; Sun, 8 Jan 2006 18:16:52 -0400 (AST) Received: from oncpfxp4-out.onc.michelin.com (unverified [10.21.4.32]) by gk-us2.us.michelin.com (Clearswift SMTPRS 5.1.7) with ESMTP id for ; Sun, 8 Jan 2006 17:15:49 -0500 Received: from ONCMH1.onc.michelin.com (ONCMH1.onc.michelin.com [156.65.124.40]) by oncpfxp4-out.onc.michelin.com (Postfix) with ESMTP id A6C0516D0B for ; Sun, 8 Jan 2006 17:16:54 -0500 (EST) Received: from oncmtap1.onc.michelin.com by oncmh1.onc.michelin.com with ESMTP for pgsql-odbc@postgresql.org; Sun, 8 Jan 2006 17:16:54 -0500 Received: from oncems01.onc.michelin.com ([156.65.125.150]) by oncmtap1.onc.michelin.com (Netscape Messaging Server 4.15) with ESMTP id ISSOK500.91C for ; Sun, 8 Jan 2006 17:16:53 -0500 Received: from [10.36.138.40] (unverified) by oncems01.onc.michelin.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Sun, 8 Jan 2006 17:16:53 -0500 Message-Id: <43C18F52.4040100@us.michelin.com> Date: Sun, 08 Jan 2006 17:16:50 -0500 From: "Campbell, Greg" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Adam Biser CC: pgsql-odbc@postgresql.org Subject: Re: Parameters.Refresh error. References: <43BAD33D.1000302@gmail.com> <20060106084609.GA7100@soptik.pzkagis.cz> <43BECB1E.4090509@gmail.com> <43BF0873.7000403@us.michelin.com> <43BF481C.3070608@gmail.com> <43C13F42.9090102@us.michelin.com> <43C15772.6080905@gmail.com> In-Reply-To: <43C15772.6080905@gmail.com> Content-Type: multipart/mixed; boundary="------------090704030705020308060908" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.184 required=5 tests=[AWL=0.032, RCVD_IN_WHOIS_INVALID=2.151, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 2.184 X-Spam-Level: ** X-Archive-Number: 200601/67 X-Sequence-Number: 6882 This is a multi-part message in MIME format. --------------090704030705020308060908 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks for clarifying. I too have used the Parametrization with command.Parameters collection in ADO with Jet/Access and MS SQL. I haven't personnaly used it with Oracle. I have never gotten it to work with PostgreSQL through any driver, although I saw a post once about it working with Npgsql for ADO.NET,..although when I tested it did not seem to work either. My test case was emulating MS stored procedures (Jet parameter queries) using the user defined function (alias stored procedures) in PostgreSQL. PostgreSQL seems to stubbornly like the "SELECT stored_proc_name(param1, param2,..)" format,..so... cmd.CommandText = "stored_proc_name" cmd.CommandType = adStoredProc cmd.Parameters.Append param cmd.Execute doesn't seem to work. Further, on Parameters there is "lazy" way and an OCD way. The lazy way is to set the statement...call cmd.Refresh,..to populate all the data types, and data sizes, then just provide the values to the parameters and execute. This way calls for an "extra" data round trip to the server to get and populate the parameters with just metadata. I'm not sure this works in pgodbc. The OCD way of course, is to... for each parameter, populate the data type and data size, and the data value. This is one less round-trip to the server, and is recommended for scaling and speed. Again, I haven't gotten this to work for stored procedures. I pass stored procedures/user defined functions,..command strings that I construct on the client "SELECT stored_proc_name(params)" My question on whether any one was doing this the parameterized way, was to try to dig out of the woodwork any of our more experience PG/ADO coders who might have stock routines for this stuff in the utility belts. Adam Biser wrote: > Campbell, Greg wrote: > >> Yes there is from the VB, data accees techniques side,.. >> or yes from the I or somebody I know has done this with pgodbc side? > > > ADO supports parameterized SQL and DB2, which I normally work with, > recommends them when executing multiple statements where only the data > values change because it improves performance. So the only thing I can > say is that I use them with the AS/400 and that, by Googling for > "parameterized sql", others appear to use them on other systems. > However, I can't get this to work with pgodbc. > > I will post code tomorrow so you and all can see what I mean. > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster --------------090704030705020308060908 Content-Type: text/x-vcard; charset=utf-8; name="greg.campbell.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="greg.campbell.vcf" begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard --------------090704030705020308060908--