-
Notifications
You must be signed in to change notification settings - Fork 38.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScriptUtils#splitSqlScript cannot deal with semicolons in stored procedures [SPR-15438] #19999
Comments
Juergen Hoeller commented Like #19952, this is hard to address by default. Using a different quoting syntax or a different separator configuration is the easiest way out here for the time being. |
vrnsky commented Juergen Hoeller fake separator is not cool. For example in my case app get schema sql file outside from app. And schema valid, but have sql triggers which does not correct compile by ResourceDatabasePopulator |
jhvhs commented I wonder whether the org.flywaydb.core.internal.database package can be leveraged. I believe there's about 6K+ lines of code the sole purpose of which is just to deal with this issue for about a dozen database engines. See https://github.com/flyway/flyway/tree/e3c9adaac18f46017ad524cbe0df26d13ab33c00/flyway-core/src/main/java/org/flywaydb/core/internal/database for more details. |
My solution: set By this setting, |
CREATE FUNCTION public.add_user(user_name character varying, user_id integer) RETURNS void
LANGUAGE plpgsql SECURITY DEFINER
AS $$DECLARE
BEGIN
INSERT INTO tbl_users (username, id) VALUES(user_name, user_id);
END$$; with error:
Is there a solution for this, yet? |
Great. Really works! |
Hi team, |
Can you share the entire procedure, I am still not able to work it out |
@kavita234, various overloaded versions of the See the Javadoc for details.
What you're looking for is the |
Thanks it works. I used |
Not sure what this does |
Phil Webb opened SPR-15438 and commented
Originally raised with Spring Boot the
org.springframework.jdbc.datasource.init.ScriptUtils#splitSqlScript
method cannot deal with semicolons that are part of a stored procedure.For example:
Affects: 4.3.7
Issue Links:
2 votes, 5 watchers
The text was updated successfully, but these errors were encountered: