pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedDescribParam
7+ messages / 3 participants
[nested] [flat]
* DescribParam
@ 2006-06-07 19:03 Glenn B. Lawler <gblawler@incodesystems.com>
0 siblings, 2 replies; 7+ messages in thread
From: Glenn B. Lawler @ 2006-06-07 19:03 UTC (permalink / raw)
To: pgsql-odbc
When I call SQLDescribeParam using PostgreSQL ODBC Driver psqlodbc-08_02_0002
SQL_ERROR is the return code.
What I am trying to do with this call is determine the buffer size needed to allocate a buffer
so I can call SQLBindParameter with a big enough buffer.
I have tried defaulting this to a number > 255, but this causes some other drivers, like
MS Access to choke.
MS SQL Server and others return the correct parameter size.
My only thought was to provide an override for this in my library to force the parameter
size when the driver does not return it.
Does anyone have a better workaround for this?
Glenn Lawler
www.incodesystems.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-07 19:23 Ludek Finstrle <luf@pzkagis.cz>
parent: Glenn B. Lawler <gblawler@incodesystems.com>
1 sibling, 0 replies; 7+ messages in thread
From: Ludek Finstrle @ 2006-06-07 19:23 UTC (permalink / raw)
To: Glenn B. Lawler <gblawler@incodesystems.com>; +Cc: pgsql-odbc
> When I call SQLDescribeParam using PostgreSQL ODBC Driver
> psqlodbc-08_02_0002 SQL_ERROR is the return code.
This API has never been supported. Why do you use it when psqlODBC
returns info that it doesn't support SQLDescribeParam?
> What I am trying to do with this call is determine the buffer size
> needed to allocate a buffer so I can call SQLBindParameter with
> a big enough buffer.
There is the problem that PgSQL backend doesn't support it before
execution (I haven't found another information yet).
> My only thought was to provide an override for this in my library
> to force the parameter size when the driver does not return it.
Maybe you may depend on other information like PostgreSQL driver, ...
> Does anyone have a better workaround for this?
Sorry, I don't have one.
Regards,
Luf
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-07 19:50 Glenn B. Lawler <gblawler@incodesystems.com>
0 siblings, 1 reply; 7+ messages in thread
From: Glenn B. Lawler @ 2006-06-07 19:50 UTC (permalink / raw)
To: pgsql-odbc
Luf,
So, if SQLDescribeParam is not supported, how do you
know how big to make the buffers?
I assume everyone must either use a standard size for
all parameters or the caller must know the right size to
use.
I guess I'll have to add an optional call to my library to
override the buffer size after the statement has been
prepared.
Glenn Lawler
www.incodesystems.com
-----Original Message-----
From: Ludek Finstrle [SMTP:luf@pzkagis.cz]
Sent: Wednesday, June 07, 2006 2:24 PM
To: Glenn B. Lawler
Cc: 'PostgreSQL ODBC List'
Subject: Re: [ODBC] DescribParam
> When I call SQLDescribeParam using PostgreSQL ODBC Driver
> psqlodbc-08_02_0002 SQL_ERROR is the return code.
This API has never been supported. Why do you use it when psqlODBC
returns info that it doesn't support SQLDescribeParam?
> What I am trying to do with this call is determine the buffer size
> needed to allocate a buffer so I can call SQLBindParameter with
> a big enough buffer.
There is the problem that PgSQL backend doesn't support it before
execution (I haven't found another information yet).
> My only thought was to provide an override for this in my library
> to force the parameter size when the driver does not return it.
Maybe you may depend on other information like PostgreSQL driver, ...
> Does anyone have a better workaround for this?
Sorry, I don't have one.
Regards,
Luf
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-07 20:08 Ludek Finstrle <luf@pzkagis.cz>
parent: Glenn B. Lawler <gblawler@incodesystems.com>
0 siblings, 0 replies; 7+ messages in thread
From: Ludek Finstrle @ 2006-06-07 20:08 UTC (permalink / raw)
To: Glenn B. Lawler <gblawler@incodesystems.com>; +Cc: pgsql-odbc
> So, if SQLDescribeParam is not supported, how do you
> know how big to make the buffers?
I don't know. I'm sorry. If you find the way with PgSQL backend
we'll be glad.
> I assume everyone must either use a standard size for
> all parameters or the caller must know the right size to
> use.
Or you have to know what you ask for. Please try standard size
and hope that it's enough. I don't have better advice.
Maybe I'm wrong and someone more experienced correct it.
BTW this is comment from psqlODBC:
/*
* Returns the description of a parameter marker.
* This function is listed as not being supported by SQLGetFunctions() because it is
* used to describe "parameter markers" (not bound parameters), in which case,
* the dbms should return info on the markers. Since Postgres doesn't support that,
* it is best to say this function is not supported and let the application assume a
* data type (most likely varchar).
*/
Regards,
Luf
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-07 23:22 Hiroshi Inoue <inoue@tpf.co.jp>
parent: Glenn B. Lawler <gblawler@incodesystems.com>
1 sibling, 0 replies; 7+ messages in thread
From: Hiroshi Inoue @ 2006-06-07 23:22 UTC (permalink / raw)
To: Glenn B. Lawler <gblawler@incodesystems.com>; +Cc: pgsql-odbc
Glenn B. Lawler wrote:
> When I call SQLDescribeParam using PostgreSQL ODBC Driver psqlodbc-08_02_0002
> SQL_ERROR is the return code.
Are you checking the 7.4+ Protocol option ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-08 14:46 Glenn B. Lawler <gblawler@incodesystems.com>
0 siblings, 1 reply; 7+ messages in thread
From: Glenn B. Lawler @ 2006-06-08 14:46 UTC (permalink / raw)
To: pgsql-odbc
Yes.
-----Original Message-----
From: Hiroshi Inoue [SMTP:inoue@tpf.co.jp]
Sent: Wednesday, June 07, 2006 6:22 PM
To: Glenn B. Lawler
Cc: 'PostgreSQL ODBC List'
Subject: Re: [ODBC] DescribParam
Glenn B. Lawler wrote:
> When I call SQLDescribeParam using PostgreSQL ODBC Driver psqlodbc-08_02_0002
> SQL_ERROR is the return code.
Are you checking the 7.4+ Protocol option ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: DescribParam
@ 2006-06-08 20:42 Hiroshi Inoue <inoue@tpf.co.jp>
parent: Glenn B. Lawler <gblawler@incodesystems.com>
0 siblings, 0 replies; 7+ messages in thread
From: Hiroshi Inoue @ 2006-06-08 20:42 UTC (permalink / raw)
To: Glenn B. Lawler <gblawler@incodesystems.com>; +Cc: pgsql-odbc
Glenn B. Lawler wrote:
> Yes.
>
Isn't the error message "Invalid parameter number for
PGAPI_DescribeParam." ?
If so, could you call SQLNumParams before calling SQLDescribeParam on
trial ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2006-06-08 20:42 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-07 19:03 DescribParam Glenn B. Lawler <gblawler@incodesystems.com>
2006-06-07 19:23 ` Ludek Finstrle <luf@pzkagis.cz>
2006-06-07 23:22 ` Hiroshi Inoue <inoue@tpf.co.jp>
2006-06-07 19:50 Re: DescribParam Glenn B. Lawler <gblawler@incodesystems.com>
2006-06-07 20:08 ` Ludek Finstrle <luf@pzkagis.cz>
2006-06-08 14:46 Re: DescribParam Glenn B. Lawler <gblawler@incodesystems.com>
2006-06-08 20:42 ` Hiroshi Inoue <inoue@tpf.co.jp>
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