A Query that works standalone but not in a f(x)

From: Ralph Smith <rsmith(at)10kinfo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: A Query that works standalone but not in a f(x)
Date: 2011-01-20 20:31:12
Message-ID: 4D389B90.8090001@10kinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Within the function I have:

for darec in select * from purchbt where addr not like ''%STE%STE%'' and
addr not like ''%STE%STE%STE%'' and (addr similar to
''%STE[A-Z]*[0-9]+'' or addr similar to ''%STE[A-Z]*[0-9]+[A-Z]'' or
addr similar to ''%STE[A-Z]*[0-9]+[A-Z][A-Z]'') loop

and it finds no records.
Outside the function, replace '' with ', I DO get the results I expect.
Back and forth, it's reliable.

I tried putting the COUNT(*) into a var and it finds 0 w/in the function
and 59K recs as a standalone query.

Any ideas?
Thanks!

--

Ralph
_________________________

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-01-20 20:59:15 Re: A Query that works standalone but not in a f(x)
Previous Message Michael Gould 2011-01-20 18:40:38 Re: Moving from SQL Anywhere to PostGres - First Time