ScriptUtils#splitSqlScript cannot deal with semicolons in stored procedures [SPR-15438]
See original GitHub issuePhil 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:
CREATE FUNCTION count_clients() RETURNS integer
LANGUAGE plpgsql
AS $$begin
select count(*) from clients;
end;$$;
Affects: 4.3.7
Issue Links:
- #19952 Oracle SQL hints are ignored as comments in ScriptUtils
2 votes, 5 watchers
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Semi-Colons in Stored Procedures - MSDN - Microsoft
One way to do this is for the language to have a set of keywords that can only be as the first token...
Read more >what's with the semicolon 1 notation in stored procedures?
With just renaming it I can run with no compilation errors; on the website I still get the error message -- "Could not...
Read more >tsql - When should I not use a semicolon? - Stack Overflow
T-SQL syntax does not require a semicolon to terminate a statement. Actually, this is deprecated 1. I can't remember for sure, but I...
Read more >Overview of stored procedures in Amazon Redshift
CREATE PROCEDURE contains SQL statements delimited with a semicolon (;). Defining an alternate delimiter such as a slash (/) and placing it at...
Read more >Writing Stored Procedures in Snowflake Scripting
clause in CREATE PROCEDURE , you cannot specify GEOGRAPHY as a column type. CREATE OR REPLACE PROCEDURE test_return_geography_table_1() RETURNS TABLE ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
vrnsky commented
jhvhs hm…looks like acceptable for me. But I think that spring community will be glad if we fix this ticket
My solution: set
spring.datasource.separator=^^^ END OF SCRIPT ^^^
.By this setting,
ScriptUtils
does not separate the content of the SQL file into multiple statements.