[Gambas-user] Bug in Gambas mySQL & DELETE &

Benoit Minisini gambas at ...1...
Mon Apr 4 11:06:57 CEST 2005


On Sunday 03 April 2005 01:09, LB Audio wrote:
> Problem in mySQL
>
> Ex:
> ....Exec("Delete from table1 where name= 'My Company & Brothers' ")
>
> Problem in string &.

The Exec(), Find(), and Edit() methods do substitutions, like the Subst() 
function - RTFM :-)

To use a '&', you must double it:

Exec("Delete from table1 where name= 'My Company && Brothers' ")

Anyway, you should use the substitution feature:

Exec("Delete from table1 where name=&1", "My Company & Brothers")

This way, you code will be portable if you change your database system.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list