MySQL Driver -- perform random queries?

Benoit St-Jean bstjean at yahoo.com
Thu May 5 06:08:14 UTC 2005


Have you tried 'BEGIN;'  or 'BEGIN TRANSACTION' ?

Are you using ODBC and if so, which MySQL ODBC driver?

What version of MySQL?

Are you using InnoDB tables or MyISAM ?

Log all valid queries you issue and you'll get a good
test suite as time goes by!  :)


--- "Anthony K." <squeak-dev at squeak.spes.ca> wrote:
> Hi all.
> 
> I'm trying to do queries from a Squeak application
> (Image 3.7 #5989)
> against a MySQL database (v4.0.24; InnoDB tables),
> using the MySQL
> driver (v1.12 from SqueakMap).
> 
> Normal queries work fine, for a couple of examples:
> statement executeQuery: 
> 	'INSERT INTO person (fName, lName)
>    	VALUES (''Bob'', 'Marley''), (''Bruce'',
> ''Springsteen''), (''Jennifer'', ''Lopez'')'.
> resultSet := statement executeQuery: 
> 	'SELECT * FROM website'.
> 
> However, I would also like to to transactions. I
> thought it would work
> to do something like bracketing a series of queries
> with:
> statement executeQuery: 'BEGIN'.
> <--various other queries-->
> statement executeQuery: 'COMMIT'.
> 
> Unfortunately, this does not work. I get the
> message:
> Error: Invalid Query: BEGIN
> 
> AFAICSee, my query is parsed, and when the word
> 'COMMIT' does not appear
> in the Dictionary initialized from
> JdmStatement:mysqlQueries, then an
> error is thrown. So I just added lines for "BEGIN",
> "COMMIT" and
> "ROLLBACK" to that array. 
> 
> No-go. There is a further problem that  aQuery, when
> validated by
> queryInfoFor:, returns [nil], which causes another
> error.
> 
> Any ideas on how to simply allow an arbitrary query
> to be sent to the
> MySQL database, and the results returned to the
> Squeak application??
> 
> Thanks for any ideas,
> 
> Anthony
> 
> 
> 
> 

-----------------
Benoit St-Jean
MySQL DBA
Yahoo! Messenger: bstjean



More information about the Squeak-dev mailing list