'snowflake substring method is not working
I tried substring method but it is not working and giving me this error.
create or replace procedure
dsa ()
returns varchar
language javascript
$$
var b="{asdfasdf}"
var c=b.substring(1);
return c;
$$;
call dsa();
SQL compilation error: syntax error line 5 at position 0 unexpected '$$ var b="{asdfasdf}" var c=b.substring(1); return c; $$'.
Solution 1:[1]
You're missing the keyword AS in your stored procedure definition. You also need to define two parameters on the overloaded JavaScript function for substring. Finally, are you sure you want to use a stored procedure for this instead of a UDF or just SQL?
create or replace procedure
dsa ()
returns varchar
language javascript
as
$$
var b="{asdfasdf}"
var c=b.substring(0,1);
return c;
$$;
call dsa();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Greg Pavlik |
