{"id":2727,"date":"2013-08-29T14:56:59","date_gmt":"2013-08-29T14:56:59","guid":{"rendered":"http:\/\/www.withdata.com\/ad\/?p=2727"},"modified":"2013-08-29T14:56:59","modified_gmt":"2013-08-29T14:56:59","slug":"how-to-execute-sql-file-via-command-line-for-db2","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/db2\/how-to-execute-sql-file-via-command-line-for-db2.html","title":{"rendered":"How to execute sql file via command line for DB2"},"content":{"rendered":"<p>You can save a\u00a0<code>.sql<\/code>\u00a0file to your hard drive, and execute it using the DB2 command line using:<\/p>\n<pre>db2 -vtf C:\\path\\to\\test.sql<\/pre>\n<p><code>-v<\/code> echoes the command text back to the command line<\/p>\n<p><code>-t<\/code> sets the statement terminator to ;.<\/p>\n<p><code>-f<\/code> tells the command line to load the commands from the file.<\/p>\n<p>See other command line options,\u00a0<a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/db2luw\/v9r7\/topic\/com.ibm.db2.luw.admin.cmd.doc\/doc\/r0010410.html\">http:\/\/publib.boulder.ibm.com\/infocenter\/db2luw\/v9r7\/topic\/com.ibm.db2.luw.admin.cmd.doc\/doc\/r0010410.html<\/a>.<\/p>\n<p>from:\u3000<a href=\"http:\/\/stackoverflow.com\/questions\/17834343\/how-to-create-batch-file-to-execute-multiple-db2-queries\">http:\/\/stackoverflow.com\/questions\/17834343\/how-to-create-batch-file-to-execute-multiple-db2-queries<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can save a\u00a0.sql\u00a0file to your hard drive, and execute it using the DB2 command line using: db2 -vtf C:\\path\\to\\test.sql -v echoes the command text back to the command line -t sets the statement terminator to ;. -f tells the command line to load the commands from the file. See other command line options,\u00a0http:\/\/publib.boulder.ibm.com\/infocenter\/db2luw\/v9r7\/topic\/com.ibm.db2.luw.admin.cmd.doc\/doc\/r0010410.html. from:\u3000http:\/\/stackoverflow.com\/questions\/17834343\/how-to-create-batch-file-to-execute-multiple-db2-queries<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[73,463,1318],"class_list":["post-2727","post","type-post","status-publish","format-standard","hentry","category-db2","tag-command-line","tag-command-line-execute-sql","tag-db2"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=2727"}],"version-history":[{"count":1,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2727\/revisions"}],"predecessor-version":[{"id":2728,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2727\/revisions\/2728"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=2727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=2727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=2727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}