Redoing INPUT/OUTPUT Code for multiple SQL Prepared Statements

Compiles, but DB_CUSTOM_V5 is not in a working state atm...
Still bits of code to refactor / readd back in