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

Re: DB insert Error

From: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: DB insert Error
Date: 2006-08-16 05:46:30
Message-ID: a47902760608152246s7dd36a97ra028d2a3b87049a3@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
I changed the datatype from varchar[] to varchar
ECPGdebug(1,stderr) says
[2998]: ECPGexecute line 97 Ok: INSERT 0 1

Its not inserting any record even though sqlcode is 0.

~Jas


On 8/16/06, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
>
> On Wed, Aug 16, 2006 at 01:20:08AM -0400, Jasbinder Bali wrote:
> > This is how the array is formed in my C code
> >
> -------------------------------------------------------------------------------------------
> > FILE   *fp;
> >
> > while(!feof(fp))
> >      {ch[i]=fgetc(fp);
> >       if(ch[i]=='\n') lines++;       i++;      }
> >    ch[i-1]='\0';
> >    fclose(fp);
> >
> ------------------------------------------------------------------------------
> > and then am inserting ch as a whole in the varchar column in the
> database.
> >
> > Do you want me to append a leading '{' and a trailing '}' to ch??
>
> Do you intend to handle the data as an array in SQL?  If not then
> the raw_email column should be declared as varchar or text instead
> of varchar[].  In that case your C code won't need to change.
>
> --
> Michael Fuhr
>

In response to

Responses

pgsql-novice by date

Next:From: Jasbinder BaliDate: 2006-08-16 05:49:25
Subject: Re: DB insert Error
Previous:From: Michael FuhrDate: 2006-08-16 05:38:02
Subject: Re: DB insert Error

pgsql-general by date

Next:From: Jasbinder BaliDate: 2006-08-16 05:49:25
Subject: Re: DB insert Error
Previous:From: Michael FuhrDate: 2006-08-16 05:38:02
Subject: Re: DB insert Error

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