{"id":3112,"date":"2014-03-16T20:28:50","date_gmt":"2014-03-16T20:28:50","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/if-condition-in-embedded-sql-collection-of-common-programming-errors\/"},"modified":"2014-03-16T20:28:50","modified_gmt":"2014-03-16T20:28:50","slug":"if-condition-in-embedded-sql-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/if-condition-in-embedded-sql-collection-of-common-programming-errors\/","title":{"rendered":"If condition in Embedded Sql-Collection of common programming errors"},"content":{"rendered":"<p>Here is a part code form my embedded SQL program<\/p>\n<pre><code>EXEC SQL IF EXISTS(SELECT * FROM table_name WHERE bool_condition)\nBEGIN\n...\nEND;\n<\/code><\/pre>\n<p>It gives the error<\/p>\n<blockquote>\n<p>An unexpected token &#8220;IF EXISTS(SELECT * FROM table_name &#8221; was found following &#8220;BEGIN-OF-STATEMENT&#8221;. Expected tokens may include: &#8220;&#8221;. SQLSTATE=42601<\/p>\n<\/blockquote>\n<p>Can anyone tell what is wrong?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a part code form my embedded SQL program EXEC SQL IF EXISTS(SELECT * FROM table_name WHERE bool_condition) BEGIN &#8230; END; It gives the error An unexpected token &#8220;IF EXISTS(SELECT * FROM table_name &#8221; was found following &#8220;BEGIN-OF-STATEMENT&#8221;. Expected tokens may include: &#8220;&#8221;. SQLSTATE=42601 Can anyone tell what is wrong?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3112","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3112"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3112\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}