Skip site navigation (1) Skip section navigation (2)

Re: How can I bind query parameters to variables ?

From: Timothy Madden <terminatorul(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: How can I bind query parameters to variables ?
Date: 2009-05-19 12:59:59
Message-ID: 5078d8af0905190559r58d50aaei260a8460ed4f17f7@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-odbc
On Mon, May 18, 2009 at 9:13 PM, Timothy Madden <terminatorul(at)gmail(dot)com> wrote:
> Hello
>
> I am using PostgreSQL 8.3.7 and psqlODBC 08.03.0400.
>
> I would like to prepare queries with parameters and bind the
> parameters to php variables on execution.
> I use php 5.2.9-1 with dbg-2.15.5 with PDO and PDO_ODBC drivers on
> Windows XP (SP3).
>
> When I use
>         PDOStatement->bindParam(parameter, value, type)
> and then execute the INSERT statement I get no error but no record is inserted !
>
[...]
>
> Do you know what can I do to get the bindParam() php call working ? Am
> I doing something wrong ?
>
> I want to insert/fetch BIT VARYING columns ("AttachmentsData") with
> bindParam, and it does not work.
> Using a php string instead of a stream is I think a bad ideea, as file
> attachments can be arbitrary large.

Ok I got it: I forgot to call PDOStatement->execute() after the calls to
bindParam() to bind php variables to query parameters. My fault !

Still the problem is I could not use Large Object data type in ODBC to
insert values
in my BIT VARYING column. It said the parameter is of type lo, which I
created as in
the how-to, but the columns is BIT VARYING. Using CAST() on the
parameter did not
help. :(


Thank you
Timothy Madden

Responses

pgsql-odbc by date

Next:From: Timothy MaddenDate: 2009-05-19 13:24:36
Subject: How to transfer binary data into a BIT VARYING column ?
Previous:From: V S PDate: 2009-05-18 05:16:41
Subject: Re: [Q] SQLMoreResults causes error in SQLFetchScroll

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group