Hi Victor,
Custom delimiters are controlled in Scriptella by using
statement.separator and statement.separator.singleline connection
properties. Originally it was developed for Oracle PL/SQL statement
blocks, but was added as a generic feature, so it is available to all
jdbc connections. It obviously lacks documentation, so thanks for
pointing out this problem, I will at least document this property on
the MySQL driver page. A ticket created to track this issue
http://javaforge.com/issue/25690
Your scripts have to be modified, so that delimiter is specified as a
connection property rather than inline statement. Please note that
delimiter is declared once and cannot be changed, so you probably need
a separate connection for it. Here is a working example:
<connection id="db_procs" url="...." >
statement.separator=$$
</connection>
<connection id="db" url="..." > <!-- normal connection for ;
separated statements -->
</connection>
<script connection-id="db_procs">
CREATE TABLE Test (ID Integer) $$
INSERT INTO Test VALUES (1)
</script>
<script connection-id="db">
INSERT INTO Test VALUES (2);
INSERT INTO Test VALUES (3);
</script>
</etl>
Additional notes:
- I think you don't need <dialect> feature in your scenario. It was
designed for cross-database scripts, where only very minor parts were
database specific. It's not used very often.
- If your are using Spring, you can also use Scriptella
EtlExecutorBean to declare and run ETLs directly from Spring
application context:
<bean id="dbInit" class="scriptella.driver.spring.EtlExecutorBean">
<property name="configLocation" value="classpath:db/
create.schema.etl.xml" />
<property name="autostart" value="true" /> <!-- If true, ETL is
executed on appCtx initialization -->
</bean>
In the ETL file you can use Spring managed datasources, by
declaring <connection driver="spring" url="beanName"/>
Regards,
Fyodor
On Jan 12, 5:37 pm, Victor Izverschi <
izverschi.vic...@gmail.com>
wrote: