Subject | Named columns in Select |
---|---|
Author | Tim Gahnström |
Post date | 2005-05-02T10:13:29Z |
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
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