VeeZ Phone VeeZ Phone - 1 month ago 8
MySQL Question

Assign value to variable when declared in mysql

Oracle used

:=
operator to assign value when variable is declared in procedure.

How we can assign value to this mysql variable

declare variable varchar(20);

Answer Source

Use set keyword after declared it

Set variable=value;

Or use default

declare variable varchar(20) default value;