In MySQL, you cannot do this: create table t (i int primary key, j int); insert into t values (1, 1); update t set j = (select max(j) from t) + 1; The UPDATE statement will raise an error as follows: SQL Error [1093] [HY000]: You can't specify target table 't' for update in FROM … Continue reading Workaround for MySQL’s “can’t specify target table for update in FROM clause” Error →
MySQL 8 does not yet support the BOOLEAN type as specified in the SQL standard. There is a DDL "type" called BOOL, which is just an alias for TINYINT: create table t(b bool); select table_name, column_name, data_type, column_type from information_schema.columns where table_name = 't'; The above produces: TABLE_NAME|COLUMN_NAME|DATA_TYPE|COLUMN_TYPE| ----------|-----------|---------|-----------| t |b |tinyint |tinyint(1) | Notice … Continue reading How to Map MySQL’s TINYINT(1) to Boolean in jOOQ →
Some databases (in particular MySQL and T-SQL databases like SQL Server and Sybase) support a very nice feature: They allow for running a "batch" of statements in a single statement. For instance, in SQL Server, you can do something like this: -- Statement #1 DECLARE @table AS TABLE (id INT); -- Statement #2 SELECT * … Continue reading How to Execute SQL Batches With JDBC and jOOQ →
This is all too simple. Here's how you can create an easy jOOQ / Google Cloud SQL integration example: Sign up with Google App Engine Sign up with Google Cloud SQL Create a Google App Engine project (preferably with Eclipse) Add jOOQ to your project Add your generated schema to your project Done Google Cloud … Continue reading jOOQ and Google Cloud SQL Example →