Last answered:

16 Sept 2022

Posted on:

15 Sept 2022

0

Scope of v_avg_salary

Hello,

Just to clarify:
We 'call' a user-defined function by using the SELECT statement, followed by the function name, then its input/s enclosed with a pair of parenthesis.

However, when you run the query SELECT v_avg_salary in 3:10, the error code 1054 only indicates that "You don't have a field/column named v_avg_salary", it doesn't say that "You use the function incorrectly". Is that right?

Thanks,
Carl

1 answers ( 0 marked as helpful)
Instructor
Posted on:

16 Sept 2022

1

Hi Carl!
Thanks for reaching out.

Yes, it means that Workbench does not find such a variable. Actually, there is such a variable but it is of another scope, not the global.

Hope this helps.
Best,
Tsvetelin

Submit an answer