Where capture/modify bulk SQL to remove some Sybase syntax

21 views
Skip to first unread message

joseaio

unread,
Jun 12, 2012, 3:28:44 AM6/12/12
to H2 Database
I need some help to find class/method where capture/modify bulk SQL to
remove some Sybase custom syntax (based on regexp?):

I would like to remove (index index_name ...) after table from/join
clauses to force use of that index on sybase.

Example:

select *
from table1 (index table1_index)
inner join table2 (index table2_index) on ...
left join table3 (index table3_index) on ...
where ...

The complete syntax to force index on sybase is:
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@Generic__BookTextView/4799;pt=4727/*

(index <index_name> [parallel [<degree_of_parallelism>]]
[prefetch <size>] [lru | mru])

please, note mandatory parenthesis.

Thank you for any help

joseaio

unread,
Jun 13, 2012, 6:21:30 AM6/13/12
to h2-da...@googlegroups.com
I capture bulk sql on constructor of org.h2.jdbc.JdbcPreparedStatement

   JdbcPreparedStatement(JdbcConnection conn, String sql, int id, int resultSetType, int resultSetConcurrency, boolean closeWithResultSet) {
Reply all
Reply to author
Forward
0 new messages