Hi!
Has some one used timestamps through ecpg in a simple C program?
How to declare, an acceptor variable to convert timestamp (w/o timezone) to a simple time_t or timeval value?

I'm using PostgreSQL 7.4.7(-6sarge1) on Debian 3.1 stable, client is also a Debian 3.1 workstation.

I have tried include "pgtypes_timestamp.h"

exec sql BEGIN DECLARE SECTION;
...
timestamp TBL_dtm;
...
exec sql AND DECLARE SECTION;



int somefunc()
{
time_t stamp;
...
exec sql FETCH NEXT TBL_cursor
INTO :TBL_dtm ...

...
stamp = TBL_dtm;

}

All other values drawn by SELECT through cursor are good but timestamp to time_t gives ZERO (1970.01.01 01:00:00:00);o(
Of course I can write my own conversion routine for string of timestamp but I now it should be ready to use in ecpg libraries!

Thanks in advance
Tovis

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedOct 14, '05 at 5:16p
activeOct 14, '05 at 5:16p
posts1
users1
websitepostgresql.org
irc#postgresql

1 user in discussion

Tövis: 1 post

People

Translate

site design / logo © 2022 Grokbase