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

Re: Insert fails from VB only when table is empty...?

From: brew(at)theMode(dot)com
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Insert fails from VB only when table is empty...?
Date: 2003-03-28 20:02:12
Message-ID: Pine.BSF.4.44.0303281456150.66270-100000@themode.com (view raw or flat)
Thread:
Lists: 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(at)theMode(dot)com)
     Check out my Musician's Online Database Exchange (The MODE Pages)
                        http://www.TheMode.com
 ==========================================================================


In response to

pgsql-novice by date

Next:From: Steve CrawfordDate: 2003-03-28 21:40:47
Subject: Re: [NOVICE] Postgres Syslog
Previous:From: Chad ThompsonDate: 2003-03-28 19:56:30
Subject: Re: Insert fails from VB only when table is empty...?

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