New syntax errors, and the sproc is still unsound for reasons given.
DDL code should not be mixed with DML code. Once DDL is verified, the DML which this sproc tries inefficiently and cumbersomely to implement is accomplished simply & efficiently with ...
Insert Into reg_conbp (`new_conbp_numerocc`, `new_conbp_rutprov`, `new_conbp_serie`, `new_conbp_fecha`,
new_conbp_monto`, `new_conbp_numcheq`, `new_conbp_nummov`, `new_conbp_numfac`)
Select
conbp_numerocc, conbp_rutprov, conbp_serie, conbp_fecha,
conbp_monto, conbp_numcheq, conbp_nummov, conbp_numfac
From tbl_conbp
Where `conbp_monto`!= 0;
One last point. MySQL on Linux is case-sensitive, and blocks of capitalised text are hard to read, so it's usually best to stick to lower case table and column names, with if you wish keywords proper case or capitalised.
Edited 2 time(s). Last edit at 04/18/2019 04:09PM by Peter Brawley.