On Fri, Sep 22, 2006 at 10:26:12AM +0200, pr0v4 wrote:
> I need to pass date type data from one table to another using the libpq
> library wich meens that I'm using the C programming language...
> PQexecparams look's like:
> res = PQexecParams(conn,
> "INSERT INTO orders
> (userid,productid,qty,nomprice,discount,totprice,delivered,orderdate) VALUES
> You can see that last 8th argument is of type QUESTION, well this is my
> question wich datatype must be declared to pass date into ?
The obvious answer is that the type should be date but I can think
of situations that need something more. If the parameter format
is binary and the parameter value is a type other than date then
you might need two casts: one to specify the parameter type and
another to cast that type to the destination column's type. For
example, if the format is binary, the value is text, and the
destination column is date, then "$8::text::date" is probably what
you need. But if the value is date then "$8::date" should work.
Is the input value in text or binary format? If binary then what
type is it? What have you tried and with what results? If you're
getting an error then please post the error message.
In response to
pgsql-novice by date
|Next:||From: Oliver Fromme||Date: 2006-09-25 15:58:36|
|Subject: Multiple UNIX-domain sockets?|
|Previous:||From: Stephan Szabo||Date: 2006-09-23 15:59:15|
|Subject: Re: assertion and company|