sqitchers / sqitch

Sensible database change management

Home Page:https://sqitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error 001003 (42000): SQL compilation error : syntax error line 6 at position 17 unexpected '<EOF>'.

hkkachhia opened this issue · comments

Hello,

I am getting error Getting error 001003 (42000): SQL compilation error : syntax error line 6 at position 17 unexpected ''.
when deploying store procedure.

The store procedure is working fine when I am executed on worksheet of snowflake portal . I am unable to find what is the issue with my store procedure.

Sounds like the SnowSQL client is hitting something it can't parse. Can you post an example here?

Thanks for the replied.

I have found the issue and fix it. As I have mentioned in my question that there is no error in Store procedure SQL script so that is correct. But the issue is that sqitch using classing console to run the script. So there is some syntax differ to run store procedure in classic console.

Here is the example of :

If you are using SnowSQL or the Classic Console, use this example instead (see Using Snowflake Scripting in SnowSQL and the Classic Console):

CREATE OR REPLACE PROCEDURE output_message(message VARCHAR)
RETURNS VARCHAR NOT NULL
LANGUAGE SQL
AS
$$
BEGIN
  RETURN message;
END;
$$
;

Yes, Sqitch uses SnowSQL to run scripts, so you will need to write things formatted for that utility.