ScriptRunner icon indicating copy to clipboard operation
ScriptRunner copied to clipboard

calling a script with parameter

Open techtoys4321 opened this issue 8 years ago • 5 comments

Is there a way to run an sql script that takes a parameter?

Thanks

techtoys4321 avatar Sep 25 '17 07:09 techtoys4321

What do you mean a parameter? Can you provide an example of what you expected to do?

BenoitDuffez avatar Sep 25 '17 18:09 BenoitDuffez

The Problem is, when you have a Function it has Semicolons in it. CREATE FUNCTION testmaximum() RETURNS TRIGGER AS $$ //some statement with semicolon $$ LANGUAGE plpgsql; The Programm must memorize the String '$$' and ignore everything until it gets the same String '$$'

sasax avatar Mar 05 '18 22:03 sasax

Just add this:

delimiter $$

at the top of your script.

BenoitDuffez avatar Mar 06 '18 03:03 BenoitDuffez

I changed the code and this is the result and it works. I uploaded it here sasax/patch-1

sasax avatar Mar 06 '18 15:03 sasax

If you feel you can improve the code, submit a pull request. Otherwise if your problem is fixed you may close this issue.

BenoitDuffez avatar Mar 06 '18 22:03 BenoitDuffez