Hey guys, I have been reading up on for loops as I am hoping to simplify one of our cleanup tasks. I started reviewing here:
and attempted to run a for loop straight up and this fails miserably, nzsql and aginity are expecting something before the FOR. Continuing my reading I've come across several examples such as this:
|CREATE OR REPLACE PROCEDURE generateTime(integer)
LANGUAGE NZPLSQL RETURNS varchar(255) AS
p_var1 ALIAS FOR $1;
p_bcd := ISNULL(p_var1, 10);
raise notice 'p_bcd=%',p_bcd;
FOR p_abc in 0..(p_bcd)
raise notice 'Hello World %', p_abc;
However when attempting something like this I get an error as follows:
|ERROR: 'CREATE OR REPLACE PROCEDURE generateTime(integer) LANGUAGE NZPLSQL RETURNS varchar(255) AS BEGIN_PROC DECLARE p_abc integer'
error ^ found "" (at char 91) unterminated BEGIN_PROC string
I'm curious how one goes about doing this?
Please sign in to leave a comment.