I have a question about the in parameter type of a stored procedure. Normally the definition of a parameter will look like this:
in param_test VARCHAR(100)
Do you know if I can defined a parameter like this?:
in param_test table.column%type
This way the parameter will be the same type as the column of an specific table. So if the column type change from varchar(100) to varchar(250) I don’t have to change the parameter type in the stored procedure.
I know It’s possible in Oracle, but I don’t know if it is in MySQL.
Thank you very much for your time and help.
Regards.
That syntax is not supported in MySQL. You need to explicitly declare the datatype for a parameter in a stored program.
If you want to protect yourself from future changes to the max length of a varchar column, you can just use the
TEXTdatatype for the parameter,