HSQL Create Procedure Syntax doesn't seem to match the documentation

后端 未结 2 1805
你的背包
你的背包 2021-01-14 00:00

I am using HSQL as my in memory test db for running integration tests. In production, I have an oracle 10g database. The idea is to run the db create scripts that I used to

相关标签:
2条回答
  • 2021-01-14 00:20

    The way I resolved this was with the following:

        <jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/install/droptables.sql" separator=";"/>
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/install/install.sql" separator="/;"/>
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.0.0.02.create_survey_tables.sql"
                     separator="/;"/>
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.01.update.sql" separator=";"/>
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.03.insert_surveyQA2.sql"
                     separator=";"/>
        <jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.05.insert_surveyQA4.sql"
                     separator=";"/>
    </jdbc:initialize-database>
    

    I can specify the delimiter in the script files. So I used a different delimiter /; in the script files that had create procedure statements that had ; separated commands.

    0 讨论(0)
  • 2021-01-14 00:35
    1. Terminate each of the SQL statements (insert, create, select etc)
        within the script (some_script.sql) with /;
    
    2. Whilst configuring in Spring - add the following:
    
       return new EmbeddedDatabaseBuilder()
        .setType("HSQL")
        .setName("DBNAME")
        .addScript("some_script.sql")
        .setSeparator("/;")
        .build();
    
    0 讨论(0)
提交回复
热议问题