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

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 (view raw or flat)
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.

pgsql-novice by date

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

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