working on conversion sql script from old hci_database