Re: libpq

Поиск
Список
Период
Сортировка
От Bruno LEVEQUE
Тема Re: libpq
Дата
Msg-id 3F98313A.4000002@net6d.com
обсуждение исходный текст
Ответ на libpq  ("creid" <creid@netbcg.com>)
Ответы derive the sequence name of a column
Список pgsql-novice

creid wrote:

>Can anyone explain to me how I can successfully fetch a date column defined
>in a 7.3 table into a c variable and have it store the date just as it is in
>the table?  platform linux, gnu C, pgsql 7.3
>
>
>
>

 From C to Postgres :


time_t                date_jour;
struct tm             *date_lisible;
time(&date_jour);
date_lisible = localtime(&date_jour);

sprintf(recherche,"DECLARE portal CURSOR FOR select lib from Thetable
where date = '01/%d/%d'::date and ....",
date_lisible->tm_mon+1,1900+date_lisible->tm_year);


res1 = PQexec(connexion,recherche);
PQclear(res1);

res1 = PQexec(connexion,"FETCH ALL in portal1");

Form Postgres to C:

use "declare portal" and not "declare portal binary" and ypu mut extract
the date like you want.

Bruno


>Thanks
>C
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to majordomo@postgresql.org so that your
>      message can get through to the mailing list cleanly
>
>
>

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno.leveque@net6d.com
http://www.net6d.com



В списке pgsql-novice по дате отправления:

Предыдущее
От: "creid"
Дата:
Сообщение: libpq
Следующее
От: "Mel Jamero"
Дата:
Сообщение: derive the sequence name of a column