How to use a dynamic cursor to validate values found in rows iwith another list and update a field in the same table with non-permitted valu

2018-06-05 08:28:41

Let's say I have _tbl (function parameter) with the following

col1, col2, col3

row1 1 , a , foo

row2 2 , b , bar

row3 1 , a , baz

row4 2 , g , birz

row5 1 , z , baz

A second table (liste_champ_valeur) list the possible values for some field but not all

table_sio (table_name) , nom_champ_sio (column_name), attribut_champ (possible_values)

_tblname , col1 , NC ( NC stand for non-concerned. The column must be ignored, no check is done)

_tblname , col2 , a

_tblname , col2 , b

_tblname , col3 , foo

_tblname , col3 , bar

_tblname , col3 , baz

The function is called for multiple tables so the table structure is not known.

I grab the table structure from information_schema as ischema (tblname.fieldlist == (col1,col2,col3)

Then I grab the p