Hi Andy,
Did you find a way to read an array element into a scalar?
According to the SQL script guide linked to above, section 7.7.4 "RETURN AN ELEMENT OF AN ARRAY" says that this sort of code should work:
CREATE PROCEDURE test (OUT output integer) READS SQL DATA AS
BEGIN
DECLARE id INTEGER ARRAY := ARRAY(1, 2, 3);
DECLARE n INTEGER := 1;
output := :id[:n];
END;
I am using SPS06 and Studio Rev 62 and the above code does not compile. It complains about this line, saying that the "[" is misplaced:
output := :id[:n];
Thanks,
Kevin.