Subject Named columns in Select
Author Tim Gahnström
I am trying to get all the first letters out of the column NAME by using the substring function and the group by clause.

It seems straight forward but apparently I am using the AS keyword wrong.

My function looks like below and I want :ltr_out to be a list of all the initial letters in the name column to make a clickable index containing only the active letters.

begin
for
select substring(name from 1 for 1) as letter
from T_MOVIES
group by letter
into :ltr_out
do suspend;
end

I get the error message
--------
Column unknown.
LETTER.
--------

I have also tried omitting the AS keyword but I guess there are some other way to name the output from substring function.

Tim