Hmm, that's surprising to me. I wasn't aware that MySQL uses backslashes
for escaping. The same queries in MySQL and Oracle:

MySQL: http://sqlfiddle.com/#!2/af671
Oracle: http://sqlfiddle.com/#!4/7ca18

Thanks for reporting this. This needs to be fixed!
https://github.com/jOOQ/jOOQ/issues/2669

The other question here is why the value is inlined...? Did you explicitly
use inlined bind values or did you set the relevant Settings flag? You
wouldn't have this problem if you were using PreparedStatements

Cheers
Lukas


2013/8/1 SB <[email protected]>

> Hello,
>
> I have the following value that I need to insert:
>
> car\
>
> Note the backslash at the end. It seems like JOOQ is generating an insert
> statement for MySQL that looks like this:
>
> insert into `database`.`TABLE` (`column1`) value ('car\')
>
> This causes the following exception to be thrown. Do I need to escape
> backslashes before inserting using JOOQ?
>
> Exception in thread "main" org.jooq.exception.DataAccessException: SQL
> [null]; You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> ....
>
> Thanks,
> -SB
>
>  --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to