2

I want to create some Postgresql (9.3) functions like "upsert" for my application in Play! Scala 2.2. I have tested one of them in the console and it worked great, but when I add it to evolutions (1.sql file) I get an error :

unterminated dollar-quoted string at or near "$$.

(I can show you the function but I'm not sure that it will help since I'm sure that the function is valid.)

I tried to end my function by ";;" instead of ";" as mentioned here : a similar SO question but without result.

So I'm asking you, what is the standard way to run SQL functions in Play ?

By the way, I will have several postgresql functions and it won't be clear if I let all of them in the 1.sql file, so is there a way to write them in other files ?

2
  • Which DB lib are you using? Slick? Anorm? Ebean? Commented Mar 19, 2015 at 11:47
  • I'm using Anorm but (I think that) it doesn't change anything since the function is executed in my evolution file and the error comes at the compilation time. Commented Mar 19, 2015 at 11:55

1 Answer 1

1

I finally found a solution: as mentioned in this thread, you need to replace ";" by ";;" but not only at the end of the function but for every ";".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.