you can continue using the SQL approach to include the zero-width space before the loanId values:
SELECT UNISTR('\200B') || loanId AS loanId FROM loan;
This SQL query will add an invisible zero-width space before each loanId value, preventing Excel from automatically converting the values to scientific notation when exported.