{"id":490,"date":"2012-01-19T08:47:45","date_gmt":"2012-01-19T08:47:45","guid":{"rendered":"http:\/\/10sa.com\/sql_stories\/?p=490"},"modified":"2012-01-19T08:47:45","modified_gmt":"2012-01-19T08:47:45","slug":"extraction-of-multi-rows-queries","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=490","title":{"rendered":"Extraction of multi rows queries"},"content":{"rendered":"<p>Sometimes, I had encountered the problem with getting the full query which was divided into many rows (as a result of developer scripting or a literal containing NEW LINE).<br \/>\nTo obtaing the full query (I needed mainly REPLACE\/INSERT) I use the following trick:<\/p>\n<pre lang=\"bash\">\r\n#!\/bin\/bash\r\n\r\n# get the content w\/o white NL, EOL.\r\nInput=$(cat < \/tmp\/my.file)\r\n# DML instructions has to be pointed out.\r\necho $Input | sed 's\/; \\(REPLACE\\|UPDATE\\|DELETE\\|INSERT\\)\/;\\n\\1\/gI'\r\n<\/pre>\n<p>Voila!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, I had encountered the problem with getting the full query which was divided into many rows (as a result of developer scripting or a literal containing NEW LINE). To obtaing the full query (I needed mainly REPLACE\/INSERT) I use the following trick: #!\/bin\/bash # get the content w\/o white NL, EOL. Input=$(cat < \/tmp\/my.file) [&hellip;]\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,3],"tags":[],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/490"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=490"}],"version-history":[{"count":6,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":500,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/490\/revisions\/500"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}