Re: no records returned

From: Lynn(dot)Tilby(at)asu(dot)edu
To: Brian Hirt <bhirt(at)mobygames(dot)com>
Cc: Lynn(dot)Tilby(at)asu(dot)edu, pgsql-general(at)postgresql(dot)org
Subject: Re: no records returned
Date: 2003-10-26 03:09:38
Message-ID: 1067137778.3f9b3af29f167@webmail.asu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi All,

Solved this problem with a tip from
James Moe <jimoe(at)sohnen-moe(dot)com> as follows:

Try this:

select * from stck_dta_tbl_oprtnl where stck_sym like 'ZRAN%';

It works PERFECTLY....

THANKS James!!!

Lynn

Quoting Brian Hirt <bhirt(at)mobygames(dot)com>:

> is it possible that there are spaces on the end? what type is
> stck_sym? if it's varchar or text the padding won't be removed
> automatically.
>
> example:
>
> basement=# create table test (t varchar(6));
> CREATE TABLE
> basement=# INSERT into test values( 'ZRAN ');
> INSERT 92249850 1
> basement=# select * from test where t = 'ZRAN';
> t
> ---
> (0 rows)
>
> basement=#
>
>
> On Oct 24, 2003, at 5:27 PM, Lynn(dot)Tilby(at)asu(dot)edu wrote:
>
> >
> > running - (PostgreSQL) 7.1.3
> >
> > I have loaded a table with stock market data.
> >
> > -
> > -
> > -
> > ZRAN |2003-09-29| 20030929| 731487| 20.81| 20.
> > ZRAN |2003-09-30| 20030930| 731488| 19.43| 20.1
> > ZRAN |2003-10-01| 20031001| 731489| 19.82| 19.9
> > ZRAN |2003-10-02| 20031002| 731490| 19.56| 20.3
> > ZRAN |2003-10-03| 20031003| 731491| 20.25| 21.
> > (609398 rows)
> >
> > pma=> select count(*) from stck_dta_tbl_oprtnl;
> > count
> > ------
> > 609398
> >
> > When I do a select * from stck_dta_tbl_oprtnl; I get the whole table
> > just fine; but when I try and retrieve just 1 record which is out
> > put when doing the select * ie:
> >
> > pma=> select * from stck_dta_tbl_oprtnl where stck_sym = 'ZRAN';
> > stck_sym|dta_date|dta_date_num|dta_date_dys|opn|hi|lw|cls|vol|unk
> > --------+--------+------------+------------+---+--+--+---+---+---
> > (0 rows)
> >
> > I get 0 rows, and no errors from postmaster.
> >
> > Is there a limit to the number of rows in a table?
> > I have also tried building a unique index composed of the stck_sym
> and
> > dta_date but I still get 0 rows.
> >
> > I have also noticed that when setting up a cursor that the first
> fetch
> > does NOT get the first record in the table, it also returns nothing
> > with
> > no errors from the postmaster. I am wondering if these bugs are
> > related.
> >
> > Thanks all for your help!!!!
> >
> > Lynn
> >
> >
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lynn.Tilby 2003-10-26 03:19:49 Re: no records returned
Previous Message Bruce Momjian 2003-10-26 02:56:15 Re: Temporary tables and miscellaneous schemas