[SQL] setting the where clause

2009-06-10 Thread johnf
Hi, I'm am programming in python using the Dabo modules. www.dabodev.com if your interested. Dabo is a framework that provides an easy way to build desktop app's. To clear a data entry form. I have been setting the where clause to "where 1=0". This of course retrieves 0 records and my form w

Re: [SQL] using a list to query

2009-05-03 Thread johnf
On Saturday 02 May 2009 06:34:57 pm Craig Ringer wrote: > johnf wrote: > > I have a list (or array) of primary keys stored in a field (data type > > text). I would like to use the list to retrieve all the data from a table > > based on the list. > >

[SQL] using a list to query

2009-05-02 Thread johnf
I have a list (or array) of primary keys stored in a field (data type text). I would like to use the list to retrieve all the data from a table based on the list. my text field contains: '123,134,343,345' I would to do something like the following: Select * from table1 where table1.pkid in (

Re: [SQL] Best practices for geo-spatial city name searches?

2009-02-24 Thread johnf
On Tuesday 24 February 2009 08:19:56 am Mark Stosberg wrote: > Hello, > > I use PostgreSQL and the "cube" type to perform geo-spatial zipcode > proximity searches. I'm wondering about the best practices also supporting > a geo-spatial distance search based on a city name rather than zipcode. > > In

Re: [SQL] Is this possible?

2009-02-17 Thread johnf
On Monday 16 February 2009 10:32:26 pm A. Kretschmer wrote: > In response to johnf : > > Hi, > > I'm not to sure this is possible. > > > > I need to replace a primary key (pkid) with the value of a different > > field. I have > > pkid = 200 >

[SQL] Is this possible?

2009-02-16 Thread johnf
Hi, I'm not to sure this is possible. I need to replace a primary key (pkid) with the value of a different field. I have pkid = 200 attendid = 301 I need the pkid = 301 But there may or may not be a pkid that already exist that has the value of 301. The attendid is unique and the pkid data

Re: [SQL] postgresql function not accepting null values inselect statement

2008-02-22 Thread johnf
On Friday 22 February 2008 01:35:47 am Bart Degryse wrote: > Can you try this... > > CREATE OR REPLACE FUNCTION getfunctionaries(p_statecd integer) > RETURNS SETOF t_functionaries AS > $BODY$ > DECLARE > rec t_functionaries%ROWTYPE; > BEGIN > FOR rec IN ( > SELECT f.functionaryid, f.categ

Re: [SQL] accounting schema

2008-02-07 Thread johnf
On Wednesday 06 February 2008 06:54:36 pm Medi Montaseri wrote: > I suppose instead of AR and AP tables, I can just have one table called > Entry (thanks Joe) with an attribute indicating AR vs AP. I recommend you not do have only one table for transaction. AR and AP are different animals an

Re: [SQL] Information schema permissions

2008-02-06 Thread johnf
On Wednesday 06 February 2008 03:37:22 pm Tom Lane wrote: > johnf <[EMAIL PROTECTED]> writes: > > Assume a standard install on Linux (what ever that means). Would a > > normal user have access to information schema? I have a front end > > written in python that acce

[SQL] Information schema permissions

2008-02-06 Thread johnf
Assume a standard install on Linux (what ever that means). Would a normal user have access to information schema? I have a front end written in python that accesses tables and permissions are set based on roles. But I do nothing with respect to the information schema view. I would like my pr