Re: [Zope] Using sql to search in zope
On Fri, 2 Jun 2000 [EMAIL PROTECTED] wrote: > I tried to build a search feature using sql in zope, this is what I normal > do in sql to do a range search : > > select * from table1 where table1_id = %field1_value% > > But when I try it with zope, it will become > > select * from table1 where table1_id = %'value'% The quoting is there to protect you (if value contains the SQL delimiter ';' or whatever it is in Access, bad things can happen and might be a big hairy security hole). Try: select * from table1 where You might need an 'op=like' attribute to the sqltest tag (I don't know Access). -- Stuart Bishop Work: [EMAIL PROTECTED] Senior Systems Alchemist Play: [EMAIL PROTECTED] Computer Science, RMIT University ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using sql to search in zope
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 02, 2000 3:10 AM Subject: [Zope] Using sql to search in zope Hi All, I tried to build a search feature using sql in zope, this is what I normal do in sql to do a range search : select * from table1 where table1_id = %field1_value% But when I try it with zope, it will become select * from table1 where table1_id = %'value'% Which return an error : [ODBC Microsoft Access 97 Driver] Syntax error in query expression 'table1_id alike %'field1_value'%'.") Any idea or work around ?? Please help Cheers Wai ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using sql to search in zope
In article <93F7843B0CACD311A5320090271F3C224D7938@redlion2>, peter <[EMAIL PROTECTED]> writes >Where's the 'LIKE' ? It's Access. -- Regards, Graham Chiu gchiucompkarori.co.nz http://www.compkarori.co.nz/index.php Powered by Interbase and Zope ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Using sql to search in zope
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes >Hi All, > >I tried to build a search feature using sql in zope, this is what I normal >do in sql to do a range search : > >select * from table1 where table1_id = %field1_value% where table1_id = -- Regards, Graham Chiu gchiucompkarori.co.nz http://www.compkarori.co.nz/index.php Powered by Interbase and Zope ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Using sql to search in zope
Where's the 'LIKE' ? Such as SELECT * FROM table1 WHERE table1_id LIKE %field1_value% -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: 02 June 2000 09:10 To: [EMAIL PROTECTED] Subject: [Zope] Using sql to search in zope Hi All, I tried to build a search feature using sql in zope, this is what I normal do in sql to do a range search : select * from table1 where table1_id = %field1_value% But when I try it with zope, it will become select * from table1 where table1_id = %'value'% Which return an error : [ODBC Microsoft Access 97 Driver] Syntax error in query expression 'table1_id alike %'field1_value'%'.") Any idea or work around ?? Please help Cheers Wai ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Using sql to search in zope
Hi All, I tried to build a search feature using sql in zope, this is what I normal do in sql to do a range search : select * from table1 where table1_id = %field1_value% But when I try it with zope, it will become select * from table1 where table1_id = %'value'% Which return an error : [ODBC Microsoft Access 97 Driver] Syntax error in query expression 'table1_id alike %'field1_value'%'.") Any idea or work around ?? Please help Cheers Wai ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )