logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: unsubscriptable object with psycopg?: msg#00000

Subject: Re: unsubscriptable object with psycopg?
Santi,

Wouldn't it be strictly correct for '=' to be used instead of "like"
(pattern-match search), for integer and other numeric field-types?

I have (2) two-column tables (like the following) that I refer to in a
more complex "parent table".  When the Zetadb GUI gens the code for a
list-box of "Media Category" (photographer, magazine, etc), it uses
'like' for search on the integer 'media_cat_id', which returns hits
for '1', '10', '11', which is of course not what I want and isn't
correct.


CREATE TABLE "media_category" (
    media_cat_id  integer  DEFAULT nextval('media_category_mc_seq')
                           CONSTRAINT media_cat_pkey PRIMARY KEY,

    category  character varying(64) NOT NULL,

    CONSTRAINT mc_cat_uniq UNIQUE (category)
);


I would humbly suggest generating '=' SQL for any numeric type.

ZetaDB is just great - thank you!  happy GNU year!
----mark

Santi Camps writes:
 > > I was able to get advanced filtering to work, sort of.  I'm wondering if
 > > the way I'm using filtering is the problem.  Do strings need to be quoted
 > > (single or double)?  Do operators need to be specified?  I've tried every
 > > combination of these that I could think of to test it, but still get the
 > > error.  See below...thanks for the help.
 > > 
 > 
 > So, advanced search works, but normal search not?  Or are you trying to
 > use a filter created by programming?
 > 
 > In generated search forms, all ways to use should work.  Strings don't
 > need to be quoted never.  In advanced search, operators are specified,
 > but in normal search, a 'like' is assumed by most fields (or '=' in
 > booleans and datetimes).  
 > 
 > If there is a way to see executing SQL, I don't know it.  You can try to
 > view what internal condition is generated putting this line at the top
 > of program_filter_action.
 > 
 > raise "debug", p_internal_condition
 > 
 > If you are not able to see what happens, please send me the creation
 > script of this table to try to reproduce the problem.
 > 
 > Good Luck
 > 
 > -- 
 > Santi Camps
 > http://zetadb.sourceforge.net
 > 
 > 
 > 


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click


<Prev in Thread] Current Thread [Next in Thread>