Another date/time question using libpq

From: Thuffman00(at)aol(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: Another date/time question using libpq
Date: 2004-08-17 07:59:17
Message-ID: 195.2d5b0256.2e534d15@aol.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Using a stored procedure (function in Postgres), I insert data which
contains a column called "creation_dt". Here I insert that date/time the row was
created. With psql I can view and confirm the data with a select statement. My
problem is retrieving the columns infornation from the result using
PQgetvalue. More specificly, how/what data type to use. PQgetvalue returns a char * and
I'm unfamilar with how to or what to cast this as that will return the
result I need. If someone could demonstrate what data type to return/cast from the
PQgetvalue and how to format that inot a date format I would be very
appreciative. Here's the function and insert statement I'm using:

.
.
.
BEGIN
v_creation_date := CURRENT_TIMESTAMP;

insert into mytable (creation_dt) values v_creation_date;

END;

TIA
Tom

BTW I'm not subscribed.

Browse pgsql-novice by date

  From Date Subject
Next Message jarednevans 2004-08-17 16:46:25 return set different in psql and MS Access/ODBC
Previous Message Pradeepkumar, Pyatalo (IE10) 2004-08-17 04:17:05 Re: [SQL] how to cast localtimestamp to bigint???