Problem: How do I get the Interactive Grid to export essential numeric values in a VARCHAR2 field to a CSV as text?
Background: We have a table that has an ORG_CODE field that is VARCHAR2(3) that contains essentially numeric data. When we export it using the Interactive Grid, Action, Download, CSV feature it drops the leading zeros (or Excel ignores them) when opened in Excel.
I suspect the latter, that Excel "sees" numeric values and treats the column as numeric data. The problem is, the ORG_CODE could contain text, but our users chose "numeric" codes rather than "alpha" codes for their organizations. So, instead of "HQ" the use "001" in the VARCHAR2 field. In the database, the leading zeroes are retained, as it treats the "001" as text.
When the values are downloaded to the CSV, Excel opens the column and displays "1" rather than "001" in the column. Our users want the leading zeros in the CSV. Is there a way to export the full three characters and get Excel to treat the field as text?
Rob
Thanks Mint, you were spot on. The raw data (viewed in notepad) has the leading zeroes.