[Bond-users] Using search with views

Dru dru at treshna.com
Thu Nov 8 18:56:25 EST 2007


There is a way to test search queries in bonddb, to
make sure that <search> tag can work with them
in bonddb/bondsql there is a app called sql_parser_test.

It could be that the view is stopping it from working.
Can you try it with a table to test if it works fine? Or
if there are problems? 

Search goes and rebuilds the SQL statement and
queries what actual fields and tables are actually
in the database.  The way views are dealt with in
postgresql vary from version to version, so if you
are creating your own sql on the fly with views
it may not work constantly across all postgresql versions.

I've now switched to using pl/pgsql  where the queries are
 built and run within the database which is a lot more powerful than
a straight <search>.
Though I am still perfecting it. I could send my sample code of that if
that helps.
<search> Is limited because it only works with straight forward
simple queries, and does not parse joins properly at all.



Colin Close wrote:
> Hi All,
>
> Can anyone tell me whether the <search> tag works with a view my efforts 
> with it seem to be futile. I'm using bits of code from the Paymaster app 
> since it does an awful lot of what I need to do.
> Here's a snippet I'm sure the structure is correct but it simply will 
> not work.
>
>     <dbobject name="visit-maintenance">
>             <sql>SELECT visit_maintenance.* FROM visit_maintenance ORDER 
> BY surname</sql>
>             <search field="surname" opr="halflike" casesensitive="false">
>                 <widget>empnamesearch</widget>
>             </search>
>             <search field="firstname" opr="halflike" casesensitive="false">
>                 <widget>empnamesearch</widget>
>             </search>
>         <loadall/>        
>     </dbobject>
>
> The table visit-maintenance is a view of a join between two tables on a 
> single field.
>
> Any help greatly appreciated.
>
> Regards
>
> Colin Close
>
> _______________________________________________
> Bond-users mailing list
> Bond-users at hcoop.net
> http://hcoop.net/cgi-bin/mailman/listinfo/bond-users
>   


-- 
Andrew Hill 
treshna Enterprises Ltd
Tel: 03 366 3649
Cel: 021 660 819
Web: www.treshna.com
IT Consultancy - Websites - Database development - Computer tech support





More information about the Bond-users mailing list