PQputline - Mailing list pgsql-general

From Bruno LEVEQUE
Subject PQputline
Date
Msg-id 35AFA79C.2641D806@unilim.fr
Whole thread Raw
List pgsql-general
I want do something like :

<begin of a function>

  char ligne[200] = "INSERT INTO compte VALUES(";

  strcat(ligne,compte);
  strcat(ligne,",\'");
  strcat(ligne,Nom_Compte);
  strcat(ligne,"\');")

< compte, Nom_Compte are *char[15] >

  res = PQexec(connexion,"BEGIN");
  PQclear(res);

  res = PQexec(connexion,"COPY compte FROM stdin");
  PQclear(res);

  PQputline(connexion,ligne);
  PQputline(connexion,"\\.\n");

  res = PQendcopy(connexion);
  PQclear(res);

   res = PQexec(connexion,"END");
   PQclear(res);

< end of function >

Question : What it's false ?


Any help accept.

Thank's


--
+++++++++++++
Bruno LEVEQUE
    CNAM
+++++++++++++

pgsql-general by date:

Previous
From: Rostislav Matl
Date:
Subject: Re: [GENERAL] listing all tables
Next
From: Maarten Boekhold
Date:
Subject: Re: [GENERAL] concatenation of string literals