pb with revdb_execute()

Klaus Major klaus.major at metascape.org
Wed Sep 4 08:49:09 CDT 2002


Bonjour Sylvain,

ca va bien ?

Since i have little experience with revdb-stuff and sql,
the following is a (wild) guess ;-)

Looks like revbd tries to execute the WHOLE field as ONE sql-statement.
Can't work...

Try this:

delete the ending ; of each line and script this in your button

...
repeat for each line l in  field "MySQL_query_build"
     put revdb_execute(the MySQL_id_connection of this card, l) into 
field "MySQL_result" ## or after fld ...
end repeat
...

Make sure each line is a REAL line (separated with CR)

> hello,
>  
> I have a field "MySQL_query_build" that contains :
>  
> UPDATE catalogue SET videoprojecteur = 'non' WHERE ref = 'SONYVPLCS3';
> UPDATE catalogue SET videoprojecteur = 'non' WHERE ref = 'POLAVIEW270';
> UPDATE catalogue SET videoprojecteur = 'non' WHERE ref = 'EPSONEMP50';
> etc.
>  
> In a button, I have:
>  
> on mouseUp
>    put revdb_execute(the MySQL_id_connection of this card, field 
> "MySQL_query_build") into field "MySQL_result"
> end mouseUp
>
> and the function return :
>  
> You have an error in your SQL syntax near ';
> UPDATE catalogue SET videoprojecteur = 'non' WHERE ref = 'POLAVIEW270';
> UPDATE' at line 1
>
> Why?
> of course, the content of my field is a correct SQL query 
> thanks
>
> Sylvain Le Gourriérec  ——  développement  —— son-video-distribution
>

Hope this helps.


Au revoir


Klaus Major
klaus.major at metascape.org




More information about the use-livecode mailing list