{"id":68823,"date":"2021-08-06T22:46:34","date_gmt":"2021-08-07T02:46:34","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/magento-2-update-data-for-a-custom-product-attribute\/"},"modified":"2021-08-06T23:09:22","modified_gmt":"2021-08-07T03:09:22","slug":"magento-2-update-data-for-a-custom-product-attribute","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=68823","title":{"rendered":"Magento 2: Update data for a custom product attribute"},"content":{"rendered":"\n<p>use bitnami_magento;<\/p>\n\n\n\n<p>SELECT * FROM bitnami_magento.catalog_product_entity_varchar<br \/>where ( attribute_id = 73 ) &#8212; and (value = &#8221;)<br \/>limit 10<\/p>\n\n\n\n<p>replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )<br \/>SELECT 181, 0, product.entity_id, left(concat(&#8220;https:\/\/www.amazon.com\/s?k=&#8221;, product.value),255)<br \/>FROM bitnami_magento.catalog_product_entity_varchar product<br \/>inner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1 )<br \/>where (product.attribute_id=73) &#8212; and (value = &#8221;) &#8212; 73 = product name<\/p>\n\n\n\n<p>SELECT * FROM bitnami_magento.catalog_product_entity_varchar<br \/>where ( attribute_id = 181 ) &#8212; and (value = &#8221;)<br \/>order by value_id desc<br \/>limit 10<\/p>\n\n\n\n<p>&#8212; Update Uk Urls &#8212;&#8211;<\/p>\n\n\n\n<p>use bitnami_magento;<\/p>\n\n\n\n<p>SELECT * FROM bitnami_magento.catalog_product_entity_varchar<br \/>where ( attribute_id = 73 ) &#8212; and (value = &#8221;)<br \/>limit 10<\/p>\n\n\n\n<p>replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )<br \/>SELECT 180, 0, product.entity_id, left(concat(&#8220;https:\/\/www.amazon.co.uk\/s?k=&#8221;, product.value), 255)<br \/>FROM bitnami_magento.catalog_product_entity_varchar product<br \/>inner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1 )<br \/>where (product.attribute_id=73) &#8212; and (value = &#8221;) &#8212; 73 = product name<\/p>\n\n\n\n<p>SELECT * FROM bitnami_magento.catalog_product_entity_varchar<br \/>where ( attribute_id = 180 ) &#8212; and (value = &#8221;)<br \/>order by value_id desc<br \/>limit 10<\/p>\n\n\n\n<p>&#8212; <strong>*<\/strong><\/p>\n\n\n\n<p>select max(value_id) from bitnami_magento.catalog_product_entity_varchar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>use bitnami_magento; SELECT * FROM bitnami_magento.catalog_product_entity_varcharwhere ( attribute_id = 73 ) &#8212; and (value = &#8221;)limit 10 replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )SELECT 181, 0, product.entity_id, left(concat(&#8220;https:\/\/www.amazon.com\/s?k=&#8221;, product.value),255)FROM bitnami_magento.catalog_product_entity_varchar productinner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1 )where (product.attribute_id=73) &#8212; and (value &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=68823\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1942,182],"tags":[],"class_list":["post-68823","post","type-post","status-publish","format-standard","hentry","category-magento-2-operations-using-sql","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":68822,"url":"http:\/\/bangla.sitestree.com\/?p=68822","url_meta":{"origin":68823,"position":0},"title":"Magento 2: Misc. Image related SQLs","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity where value_id in (232574, 242521) -- 232574, 242521 select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity where value_id in (232574, 242521) -- where value like '%ud6vtf2a_5ezdxueqvnr%' --select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity select * from bitnami_magento.catalog_product_entity_media_gallery -- where value_id in (237733, 237734) where value like '%ud6vtf2a_5ezdxueqvnr%' update bitnami_magento.catalog_product_entity_media_gallery set value = '\/u\/d\/ud6vtf2a_5ezdxueqvnr1dyny_1.jpeg'\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27105,"url":"http:\/\/bangla.sitestree.com\/?p=27105","url_meta":{"origin":68823,"position":1},"title":"Magento 2, Update a Product Attribute with SQL","author":"Sayed","date":"May 11, 2021","format":false,"excerpt":"update catalog_product_entity_int set catalog_product_entity_int.value = 1 where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id = ( select entity_id from ( SELECT product.entity_id as entity_id FROM bitnami_magento.catalog_product_entity product inner join catalog_product_entity_decimal price on price.entity_id = product.entity_id and (price.attribute_id in (78)) inner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97) where (price.value >\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68814,"url":"http:\/\/bangla.sitestree.com\/?p=68814","url_meta":{"origin":68823,"position":2},"title":"Magento 2: Deactivate Products without images","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"update catalog_product_entity_int -- select * from catalog_product_entity_int set catalog_product_entity_int.value = 2 where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id in ( select entity_id from ( Select distinct(product.entity_id) FROM bitnami_magento.catalog_product_entity product left join catalog_product_entity_media_gallery_value_to_entity valentity on valentity.entity_id = product.entity_id left join catalog_product_entity_media_gallery image on image.value_id = valentity.value_id and (image.attribute_id in (90)) inner join\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14842,"url":"http:\/\/bangla.sitestree.com\/?p=14842","url_meta":{"origin":68823,"position":3},"title":"Misc Linux Commands (CentOS\/Redhat) that you might find useful","author":"Sayed","date":"June 28, 2019","format":false,"excerpt":"1 php -v 2 yum repolist 3 yum repolist | remi 4 yum repolist | grep remi 5 yum repolist | grep ius 6 yum makecache 7 yum update 8 reboot 9 adduser ariro 10 passwd ariro 11 usermod -a -G apache ariro 12 adduser magento 13 passwd magento 14\u2026","rel":"","context":"In &quot;Magento 2&quot;","block_context":{"text":"Magento 2","link":"http:\/\/bangla.sitestree.com\/?cat=1907"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25053,"url":"http:\/\/bangla.sitestree.com\/?p=25053","url_meta":{"origin":68823,"position":4},"title":"Misc Linux Commands (CentOS\/Redhat) that you might find useful #Root","author":"Author-Check- Article-or-Video","date":"April 15, 2021","format":false,"excerpt":"1 php -v 2 yum repolist 3 yum repolist | remi 4 yum repolist | grep remi 5 yum repolist | grep ius 6 yum makecache 7 yum update 8 reboot 9 adduser ariro 10 passwd ariro 11 usermod -a -G apache ariro 12 adduser magento 13 passwd magento 14\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":15981,"url":"http:\/\/bangla.sitestree.com\/?p=15981","url_meta":{"origin":68823,"position":5},"title":"Update magento 2","author":"Sayed","date":"August 16, 2019","format":false,"excerpt":"php bin\/magento setup:upgrade php bin\/magento setup:di:compile","rel":"","context":"In &quot;Magento 2&quot;","block_context":{"text":"Magento 2","link":"http:\/\/bangla.sitestree.com\/?cat=1907"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68823"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68823\/revisions"}],"predecessor-version":[{"id":68832,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68823\/revisions\/68832"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68823"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}