Dec-19-2022, 09:16 PM
(Dec-19-2022, 07:19 PM)deanhystad Wrote: Wrap code in python tags to save formatting
Python csv.writer will write null as a blank string. Actually, it writes None as a blank string. Database nulls are converted to Python Nones.
Knowing that you cannot write a None (or a null) to a csv file, what do you want to write? Maybe replace all occurrences of None in myresult to the string "null"?
Thank you for your reply. Yes I would try to get something other than blank for DB NULL value. I am not sure what will be best but I think using NaN might be a good idea. I will use these values to load into oracle DB and there also I want to be able to insert DB NULL or blank to match what was in the MySQL DB. Using NaN might help to insert NULL using pandas and numpy.