select max(client.CODE) from client ; into array lctemp insert into client (code) values (IIF(isnull(lcTemp),1,lctemp + 1))