M mozaharul Active Member Licensed User Jan 19, 2011 #1 Hi, How could I convert a SQLite database to CSV file when some columns in the database have null values. while converting gives the error attached. The syntex used : WaitCursor(True) con.BeginTransaction cmd.CommandText = "select * from kap" cmd.ExecuteTable("table3",0) con.EndTransaction If SaveDialog1.Show <> cCancel Then Table3.SaveCSV (SaveDialog1.File,",",True) Msgbox("CSV file has been created") End If WaitCursor(False) regards, Attachments Error.JPG 18.4 KB · Views: 528
Hi, How could I convert a SQLite database to CSV file when some columns in the database have null values. while converting gives the error attached. The syntex used : WaitCursor(True) con.BeginTransaction cmd.CommandText = "select * from kap" cmd.ExecuteTable("table3",0) con.EndTransaction If SaveDialog1.Show <> cCancel Then Table3.SaveCSV (SaveDialog1.File,",",True) Msgbox("CSV file has been created") End If WaitCursor(False) regards,
Erel B4X founder Staff member Licensed User Longtime User Jan 19, 2011 #2 You can use the IFNULL method in your query. Something like: Code: cmd.CommandText = SELECT col1, col2, IFNULL(col3, '0') FROM kap" Add IFNULL for all problematic columns.
You can use the IFNULL method in your query. Something like: Code: cmd.CommandText = SELECT col1, col2, IFNULL(col3, '0') FROM kap" Add IFNULL for all problematic columns.