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

Re: [NOVICE] 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: [NOVICE] DB insert Error
Date: 2006-08-18 01:19:37
Message-ID: a47902760608171819s76ec0267s359d37b4bc0d3a2a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
My program started working.
Its inserting records now.
I've done no significant changes in my C code.
Thanks alot for your help.

Jasbinder


On 8/17/06, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
>
> On Thu, Aug 17, 2006 at 10:19:57AM -0400, Jasbinder Bali wrote:
> > but i don't see any record getting inserted in the table..
> > Why is that happenening.
>
> How exactly are you determining that the record isn't being inserted?
> Are you sure you're connected to the right database and querying
> tables in the right schema?
>
> Here's a complete example for you to try:
>
> 1. Create the following table:
>
> CREATE TABLE public.foo (
>    id   integer PRIMARY KEY,
>    msg  text NOT NULL
> );
>
> 2. Compile the following program:
>
> int main(void)
> {
>    EXEC SQL BEGIN DECLARE SECTION;
>    char  msg[] = "This is a test.";
>    EXEC SQL END DECLARE SECTION;
>
>    ECPGdebug(1, stderr);
>
>    /* Adjust the next line as necessary. */
>    EXEC SQL CONNECT TO tcp:postgresql://192.168.0.110/xyz USER jsbali;
>    EXEC SQL INSERT INTO public.foo (id, msg) VALUES (1, :msg);
>    EXEC SQL COMMIT;
>    EXEC SQL DISCONNECT;
>
>    return 0;
> }
>
> 3. Run the above program and post all output it generates.
>
> 4. Connect to the database with psql or whatever client you use,
> execute the following query, and post the output:
>
> SELECT * FROM public.foo;
>
> Also, what version of PostgreSQL are you using and what platforms
> are the server and client?  I don't recall if you've said.
>
> --
> Michael Fuhr
>

In response to

Responses

pgsql-novice by date

Next:From: Roger RasmussenDate: 2006-08-18 01:39:32
Subject: Re: Optimal Postgres Development Process, Software
Previous:From: Michael FuhrDate: 2006-08-17 20:07:13
Subject: Re: [NOVICE] DB insert Error

pgsql-general by date

Next:From: Daniel StaalDate: 2006-08-18 01:51:00
Subject: Re: [GENERAL] DB insert Error
Previous:From: ChrisDate: 2006-08-18 00:53:26
Subject: Re: count and limit

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