From: Campbell, Greg <greg.campbell@us.michelin.com>
To: Adam Biser <adambiser@gmail.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Parameters.Refresh error.
Date: Sun, 08 Jan 2006 17:16:50 -0500
Message-ID: <43C18F52.4040100@us.michelin.com> (raw)
In-Reply-To: <43C15772.6080905@gmail.com>
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>
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
Attachments:greg.campbell.vcf (text/x-vcard, 239B) download
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: greg.campbell@us.michelin.com, adambiser@gmail.com
Subject: Re: Parameters.Refresh error.
In-Reply-To: <43C18F52.4040100@us.michelin.com>
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> <43C18F52.4040100@us.michelin.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox