-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.cl
More file actions
39 lines (37 loc) · 1.79 KB
/
Copy pathtest.cl
File metadata and controls
39 lines (37 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(in-package "TOKYO-TYRANT")
(defvar *test-table-data*
`(("1" . ,(alist-to-hash-table '(("name" . "空条承太郎")
("sex" . "male")
("hdate" . "20050321")
("div" . "brd,dev"))
:test 'equal))
("81" . ,(alist-to-hash-table '(("name" . "東方仗助")
("sex" . "male")
("hdate" . "20060601")
("div" . "dev"))
:test 'equal))
("92" . ,(alist-to-hash-table '(("name" . "汐華初流乃")
("sex" . "male")
("hdate" . "20070311")
("div" . "hr" ))
:test 'equal))
("127" . ,(alist-to-hash-table '(("name" . "空条徐倫")
("sex" . "female")
("hdate" . "20070523")
("div" . "brd,hr"))
:test 'equal))))
(defun test-0 (host port)
(let ((tbl (make-instance 'RDBTBL)))
(tt-open tbl host port)
(tt-setindex tbl "name" *ITLEXICAL*)
(loop for (k . v) in *test-table-data*
do (tt-put tbl k v))
(let ((qry (make-instance 'RDBQRY)))
(tt-qry-initialize qry tbl)
(tt-qry-addcond qry "name" *QCSTRBW* "空条")
(tt-qry-setorder qry "hdate" *QONUMDESC*)
(prog1
(let ((result (tt-qry-search qry)))
(loop for key in result
collect (hash-table-to-key-value-list (tt-get tbl key))))
(tt-close tbl)))))