.
D 2021-04-08T05:22:15.941
J assignee nobody
J closer nobody
J cmimetype text/html
J comment <p>Running\son\sWindows\s10\sPro\s64-bit\sBuild\s19042</p>\r\n\r\n<p>While\swriting\sa\sTcl\sscript\sto\sexport\sMS\sAccess\stables\sto\sCSV\sfiles,\sI\swas\susing\sthe\s<code>tdbc::odbc</code>\spackage\salong\swith\sthe\ssystem\sAccess\sdriver\sin\s64-bit\smode.</p>\s\s\r\n\r\n<p>As\smentioned\sin\sthe\sdocumentation\sfor\s<code>tdbc::resultset\snextdict</code>\s(which\s<code>foreach</code>\suses):\s<blockquote><em>"If\sa\scolumn's\svalue\sin\sthe\srow\sis\sNULL,\sits\skey\sis\somitted\sfrom\sthe\sdictionary."</em></blockquote>\s\sUnfortunately\sI\sdidn't\ssee\sthis\sdetail\suntil\sI\shad\sfinished\swriting\sthe\sbulk\sof\smy\scode.\s\sBecause\sthe\skey\sand\svalue\sboth\sare\smissing\sfrom\sthe\sresultset\sdictionary\swhen\sthe\svalue\sis\sNULL,\sthis\sleaves\sunwanted\smissing\sfields\sin\sthe\sCSV\soutput\swhen\susing\ssomething\slike\sthis\s(untested\sconcept\scode):\r\n</p>\r\n\r\n<pre>\r\nset\sf\s[open\s"c:/users/will/desktop/table-dump.csv"\s"w"]\r\n\r\n$resultset\sforeach\srow\s{\r\n\s\sforeach\s{key\svalue}\s$row\s{\r\n\s\s\s\sputs\s-nonewline\s$f\s"$key,"\r\n\s\s\s\sputs\s$f\s"$value"\r\n\s\s}\r\n}\r\n\r\n...\r\n</pre>\r\n\r\n<p>\r\nI\sworked\saround\sthis\sissue\sby\susing\sa\s<code>nextlist</code>\swith\s<code>while</code>\sand\smore\scomplicated\ssupport\scode,\sbut\sI\sfeel\sthis\sshouldn't\shave\sbeen\snecessary.\s\sIf\sthe\s<code>$resultset\sforeach</code>\shad\san\s<code>-emptystringsfornulls</code>\s(or\ssome\sother\sbetter-named)\soption\sthat\swould\sallow\sthe\skey\sto\sremain\sin\sthe\sdictionary,\sbut\swith\san\sempty\sstring\sas\sa\svalue,\sthis\swould\shave\sallowed\sme\sto\suse\smy\ssimple\s<code>$resultset\sforeach</code>\scode\swithout\soutputing\smissing\skeys.
J foundin 8.6.10
J is_private 0
J login willbprog2762
J priority 5\sMedium
J private_contact 937334650b1c1edd786dc48f2296354a1a36004a
J resolution None
J severity Minor
J status Open
J submitter willbprog2762
J subsystem 81.\sBundled\sPackages
J title tdbc::odbc\sresultset\sforeach\sneeds\san\soption\sto\sallow\sempty\svalues
J type RFE
K 93c149626935bb9c7e4d7b727af6a0192b5a59a8
U willbprog2762
Z 90d74cb89c4de9cc85518161dd168ec2