Re: Insert fails from VB only when table is empty...? - Mailing list pgsql-novice

From brew@theMode.com
Subject Re: Insert fails from VB only when table is empty...?
Date
Msg-id Pine.BSF.4.44.0303281456150.66270-100000@themode.com
Whole thread Raw
In response to Insert fails from VB only when table is empty...?  ("LaBranche, Kevin" <klabranche@co.coconino.az.us>)
List pgsql-novice
Kevin......

> I am brand new to pgsql... :-)  I have a VB program inserting records
> into a fairly simple table (without a PK) and I notice that when the
> table is empty I get a "row out of range" error.  This only happens when
> the table is empty.

I use PHP instead of VB, but it sounds like you should only try to fetch
the rows if some exist.  In php the first row fetch starts at zero, so if
there is one row you ask for n-1, i.e. row zero.  If no rows exist you use
an if statement to skip around the row fetch (and maybe print a no info
found message).

Maybe this is what's happening to you.

later....

brew

 ==========================================================================
                  Strange Brew   (brew@theMode.com)
     Check out my Musician's Online Database Exchange (The MODE Pages)
                        http://www.TheMode.com
 ==========================================================================


pgsql-novice by date:

Previous
From: "Chad Thompson"
Date:
Subject: Re: Insert fails from VB only when table is empty...?
Next
From: Steve Crawford
Date:
Subject: Re: Postgres Syslog