{"id":556,"date":"2006-02-01T01:00:00","date_gmt":"2006-01-31T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2006-02-01-1.html"},"modified":"2026-08-10T14:35:03","modified_gmt":"2026-08-10T05:35:03","slug":"2006-02-01-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2006-02-01-1.html","title":{"rendered":"SQLite3.x \u3067 COPY \u3092\u4f7f\u3046\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b"},"content":{"rendered":"<p>\nSQLite3.x \u3067<\/p>\n<blockquote><p>COPY footable from &#8216;foo.csv&#8217; USING DELIMITERS &#8216;,&#8217;;\n<\/p><\/blockquote>\n<p>\u306a\u3069\u3068\u3057\u3066 csv \u304b\u3089\u8aad\u307f\u8fbc\u3082\u3046\u3068\u3059\u308b\u3068\u3001\n<\/p>\n<blockquote><p>SQL error: near &#8220;COPY&#8221;: syntax error\n<\/p><\/blockquote>\n<p>\u3068\u306a\u308a\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n&nbsp;<br \/>\n\u8abf\u3079\u3066\u307f\u308b\u3068\u30013.0 \u4ee5\u964d\u524a\u9664\u3055\u308c\u305f\u6a5f\u80fd\u3060\u305d\u3046\u3067\u3001\u516c\u5f0f\u306e\u30d0\u30b0\u30c8\u30e9\u30c3\u30af\u306b\u3088\u308b\u3068\n<\/p>\n<blockquote><p>3.0 \u4ee5\u964d\u3001\u4e0d\u81ea\u7531\u3067\u3059\u304c COPY \u30b3\u30de\u30f3\u30c9\u306f\u524a\u9664\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f SQL \u975e\u6a19\u6e96\u3067\u3042\u308a\u3001UTF-16 \u3067\u306e\u5b9f\u88c5\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u304b\u898b\u51fa\u305b\u306a\u304b\u3063\u305f\u305f\u3081\u3067\u3059\u3002\n<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3057\u305f\u3002<br \/>\n&nbsp;<br \/>\n2.x \u3068 3.x \u3092\u4e21\u65b9\u3044\u308c\u3066\u30012.x \u3067 csv \u304b\u3089\u30b3\u30d4\u30fc\u3057\u3066dump\u3057\u3066\u3084\u308b\u3053\u3068\u3067 3.x \u3067\u3082 CSV \u306e\u5229\u7528\u306f\u53ef\u80fd\u3067\u3059\u3002\n<\/p>\n<blockquote><p>$ sqlite \/tmp\/foocsv.tmp &#8220;COPY foo FROM &#8216;foo.csv&#8217; USING DELIMITERS &#8216;,'&#8221;<br \/>\n$ sqlite \/tmp\/foocsv.tmp &#8216;.dump&#8217; > \/tmp\/foocsv.sql<br \/>\n$ sqlite3 .\/applyTo.db < \/tmp\/foocsv.sql\n<\/p><\/blockquote>\n<p>&nbsp;<br \/>\n\u53c2\u8003:<br \/>\n&#8211; Ticket 982: COPY command does not work in 3.0.8 as it does in 2.8.13<br \/>\n&#8211; SQLite \u304c\u8a8d\u8b58\u3067\u304d\u308b\u30af\u30a8\u30ea\u8a00\u8a9e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQLite3.x \u3067 COPY footable from &#8216;foo.csv&#8217; USING DELIMITERS &#8216;,&#8217;; \u306a\u3069\u3068\u3057\u3066 csv \u304b\u3089\u8aad\u307f\u8fbc\u3082\u3046\u3068\u3059\u308b\u3068\u3001  &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2006-02-01-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">SQLite3.x \u3067 COPY \u3092\u4f7f\u3046\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[141],"tags":[41],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-lifehack","tag-sqlite"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":2,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":1548,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/556\/revisions\/1548"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}