When exporting the result data set to Excel file. By using the steps below, there are values with leading 0s in some of the columns in the Oracle table, but when exporting the dataset to Excel file, the leading 0s are eliminated and the field in the Excel file is interpreted as a numeric field.
For example TOAD for Oracle displays:
000000000000475926
Excel file displays:
475926
Is there a way that the leading 0s are retained?
Toad is working the way it is designed. The reason is that when you copy to the clipboard and paste it into excel, Excel thinks it is a number and hence the leading 00's are ignored (MSFT Technology) same is the case with the Excel instance. However, when you export from Toad and choose the format Excel file (some numbers with leading 00's) Toad forces eXcel to ignore the leading 0's as it is a string. To verify this you may copy to clipboard and paste to note pad and you will see that all the leading zero's are copied.
So to keep the leading zero, please use the format option Excel File when doing an Export Data set and export to a file.
RESOLUTION:
1. Right click on the data grid and select Export Data Set.
2. Select for format Excel file.
3. Direct where to save the file.