question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScriptUtils#splitSqlScript cannot deal with semicolons in stored procedures [SPR-15438]

See original GitHub issue

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:

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:open
  • Created 6 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
spring-projects-issuescommented, Jan 11, 2019

vrnsky commented

jhvhs hm…looks like acceptable for me. But I think that spring community will be glad if we fix this ticket

1reaction
rj-hwangcommented, Jul 21, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found