Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mori-dev/293530 to your computer and use it in GitHub Desktop.
Save mori-dev/293530 to your computer and use it in GitHub Desktop.
(defun my-make-insert-sql (st en path)
(with-temp-buffer
(loop for i from st to en
do (insert (format
"INSERT INTO hoge.member (uid,mmmid) VALUES (%d,%d);\n"
i i))
do (insert (format
"INSERT INTO hoge.vice (uid,fooid) VALUES (%d,1);\n"
i))
(loop for j from 1 to 22
do (insert (format
"INSERT INTO ff.ot (meid,coid,meff) VALUES (%d,%d,99999999);\n"
i j))))
(delete-backward-char 1)
(write-region (point-min) (point-max) path)))
(my-make-insert-sql 2000000 2000003 "~/hoge.sql")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment