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

problems with libpq on windows

From: "Egidijus Kizlaitis" <egidijus(at)xxl101(dot)lt>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: problems with libpq on windows
Date: 2001-10-27 13:48:49
Message-ID: 000f01c15eee$1b769c30$0e00a8c0@xxl101.xxl101.lt (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hi

i am developing windows c++ application using libpq. i am using binary cursor to select table data.
how do i retrieve timestamp data from table? how can i convert it to time_t or struct tm? 

char* val = PQgetvalue(pgres,i,j);

for numbers code looks like that:
nVal = * ((int *) val);

for timestamp i tryied this code:

#include "postgres.h" 
#include "utils/timestamp.h"

.....

tmstampVal = * (Timestamp*) val;
timestamp2tm(tmstampVal, &tzp, &sttm, &fsec, (char**)&tzn);

.....

but then compiling program i got error: 
error LNK2001: unresolved external symbol "int __cdecl timestamp2tm(double,int *,struct tm *,double *,char * *)" (?timestamp2tm@@YAHNPAHPAUtm@@PANPAPAD(at)Z)

what am i doing wrong?

thanx
Egidijus





pgsql-interfaces by date

Next:From: Gilberto Ribeiro de QueirozDate: 2001-10-27 20:30:33
Subject: How to obtain the size of a field VARCHAR, NUMERIC(7,2) after a query with libpq?
Previous:From: Antonio Sergio de Mello e SouzaDate: 2001-10-26 16:21:21
Subject: Fetching fields of a cursor into a struct, with ECPG

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