{"id":1308,"date":"2022-08-30T15:15:27","date_gmt":"2022-08-30T15:15:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/trouble-with-sql-join-on-update-statement-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:27","modified_gmt":"2022-08-30T15:15:27","slug":"trouble-with-sql-join-on-update-statement-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/trouble-with-sql-join-on-update-statement-collection-of-common-programming-errors\/","title":{"rendered":"Trouble with SQL join on update statement-Collection of common programming errors"},"content":{"rendered":"<p>Having a bad time figuring out what is wrong with my update statement. Been a couple of years since I wrote any scripts. Can anybody tell me what I am doing wrong? Select Statement work fine. SELECT DESCRIPTION from maximo.inventory join maximo.item on inventory.itemnum = item.itemnum WHERE MAXIMO.ITEM.ITEMNUM=MAXIMO.INVENTORY.ITEMNUM AND<\/p>\n<p>(MAXIMO.INVENTORY.MANUFACTURER=&#8217;UNKNOWN&#8217; OR MAXIMO.INVENTORY.MANUFACTURER IS NULL) AND<\/p>\n<p>INSTR(UPPER(MAXIMO.ITEM.DESCRIPTION),&#8217;OMRON&#8217;) &gt; 0; Yet there is something wrong in the update statement that I cannot see although I know it should be easy to find. HELP!! update maximo.inventory set maximo.inventory.manufacturer=&#8217;OMRON&#8217; from maximo.inventory join maximo.item on maximo.inventory.itemnum = maximo.item.itemnum WHERE MAXIMO.ITEM.ITEMNUM=MAXIMO.INVENTORY.ITEMNUM AND<\/p>\n<p>(MAXIMO.INVENTORY.MANUFACTURER=&#8217;UNKNOWN&#8217; OR MAXIMO.INVENTORY.MANUFACTURER IS NULL) AND<\/p>\n<p>INSTR(UPPER(MAXIMO.ITEM.DESCRIPTION),&#8217;OMRON&#8217;) &gt; 0; Error starting at line 8 in command: update inventory set manufacturer=&#8217;OMRON&#8217; from maximo.inventory left outer join maximo.item on maximo.inventory.itemnum=maximo.item.itemnum WHERE MAXIMO.ITEM.ITEMNUM=MAXIMO.INVENTORY.ITEMNUM AND<\/p>\n<p>(MAXIMO.INVENTORY.MANUFACTURER=&#8217;UNKNOWN&#8217; OR MAXIMO.INVENTORY.MANUFACTURER IS NULL) AND<\/p>\n<p>INSTR(UPPER(MAXIMO.ITEM.DESCRIPTION),&#8217;OMRON&#8217;) &gt; 0 Error at Command Line:9 Column:24 Error report: SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 &#8211; &#8220;SQL command not properly ended&#8221; *Cause: *Action: Line 9 Column 24 is at the end of this statement<\/p>\n<p>set manufacturer=&#8217;OMRON&#8217;<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:15:55. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Having a bad time figuring out what is wrong with my update statement. Been a couple of years since I wrote any scripts. Can anybody tell me what I am doing wrong? Select Statement work fine. SELECT DESCRIPTION from maximo.inventory join maximo.item on inventory.itemnum = item.itemnum WHERE MAXIMO.ITEM.ITEMNUM=MAXIMO.INVENTORY.ITEMNUM AND (MAXIMO.INVENTORY.MANUFACTURER=&#8217;UNKNOWN&#8217; OR MAXIMO.INVENTORY.MANUFACTURER IS NULL) AND [&hellip;]<\/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-1308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1308","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=1308"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1308\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}