Q: how to convert varchar to bigint in mysql DECLARE a_varchar_variable varchar(20) DEFAULT "999999999999999";
DECLARE a_biginteger_variable BIGINT;

In my mysql stored procedure, this is working fine:
a_biginteger_variable = CONVERT(a_varchar_variable,UNSIGNED INT);

On the other hand, This gives a syntax error:
a_biginteger_variable = CONVERT(a_varchar_variable,BIGINT);

I would like to understand what causes this behavior. and how to convert varchar to bigint?
It seems to be a repeating question on google but no answer found. which is weird because I though it should be easy.

A: a_biginteger_variable = CAST(a_varchar_variable as SIGNED INTEGER);
Usually it return a bigint.

A: Mainly, I needed to change varchar to int because i wanted to loop over a certain variable..
I tried adding 1 on varchar as a solution and it worked fine in the loop
a_varchar_variable = a_varchar_variable + 1

