Error : could not send data to server: Error 0

"pawan shirbhate" <[email protected]>
Newsgroups gmane.comp.db.postgresql.interfaces
Message-ID <[email protected]>
Hi,

I am getting following error while sending the 15000 records using
PQputline() to postgreSQL DB.

*could not send data to server: Error 0*

Code snap:-

      strBuf =
"abc1798,2,26120,34760,653,869,60880,1522,05/24/2007,123456712";
      strBuf += "\n";
      printf("\n%s\n",strBuf.c_str());

  for(i=0;i<15000;i++)
  {
      /*  Send a single row */
      copy_result = PQputline(conn, strBuf.c_str());
      if(copy_result != 0)
      {
          printf("\n%s\n", PQerrorMessage(conn));
     }

  }

  copy_result = PQendcopy(conn);
  if(copy_result != 0)
  {
      printf("\n%s\n", PQerrorMessage(conn));
  }

Platform - Solaris 10 (x86 based processor)
PostgreSQL version - 8.2.0
Interface - libpq
Application language - C/C++

Appreciate help!!!

Regards,
Pawan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.