【发布时间】:2019-04-04 03:05:53
【问题描述】:
我正在尝试使用 HugSQL 从我的数据库中选择一些记录并取回记录 当我尝试这段代码时,我遇到了一些问题:
f/attempt-all [_ (println "Getting DB records")
db-records (oracle-db/get-records my-db)
;hangs here when there are large(100,000k+) records
和
-- :name get-records
select /*+ index(src_ski_sysevents_au SRC_SKI_SYSEVENTS_AU_IDX_A)*/ * from src_ski_sysevents_au where week_id='201903' AND ROWNUM <'10000'
实际结果: db-records 有一个地图列表(返回的每条记录的地图),如下所示:
({:remarks nil, :timeprocessing 1994-01-01 00:00:00.000, :devicetype 3M, :staffcode 0M,
:timedeletion 1994-01-01 00:00:00.000, :occurred 1M, :syseventdesig Ticket jam, :time 2019-01-14 10:47:37.350, :syseventno 27M,
:devicedesig P4 LH Exit Wilga ST - 49, :devicenoprocessing 0M, :component nil, :lotabbr P3P4, :deviceabbr P4 LEX WIL,
:week_id 201903M, :lotdesig P3, P4 Levels, :dss_update_time #inst "2019-01-14T15:48:46.000000000-00:00", :loaded_new_yn N,
:operatorfirstname nil, :quantity 1M, :systemeventregno 7365M, :pdi_batch_id 697410M, :lotno 1M, :deviceno 49M, :deleted_yn N,
:centre_no 0012000, :lot_no 0012001, :operatorsurname unattended, :operatornoprocessing 0M}
...
)
我想知道如何将此映射列表转换为 Json 字符串文件或 CSV 文件以将其推送到我的端点。在处理像
这样的非字符串值时:时间处理 1994-01-01 00:00:00.000
当我将这个测试字符串放入(comment (def testmap {input_test_Data})) 以无效数字格式进行测试时,我会看到这些错误,我还发现
:dss_update_time 在我的数据库中是“15/JAN/19”
但在 HugSQL 结果中,我得到了类似的结果
:dss_update_time #inst "2019-01-14T15:48:46.000000000-00:00"
基本上我将如何确保我取回所有数据 至少我的问题的第二部分会非常感谢一些帮助。谢谢
【问题讨论】: