Jump to content

Resolved - Copy data from one column to another in same table?


Dirty Butter

Recommended Posts

I tried   UPDATE `CubeCart_inventory` SET description_short=seo_meta_description  but it did not work.

I use long detailed descriptions on our estates collectibles, but I already have a fairly short meta description. I would like to copy the meta description to the short description. I'll still want to do some editing to short, but it will be easier if I have a starting point with the meta description.

Link to comment
Share on other sites

I am going to assume that in SQL, anything following an equals sign could be interpreted as a string literal. If that is plausible, then I would suggest a query where the column names are enclosed in backticks.

UPDATE `CubeCart_inventory` SET `description_short` = `seo_meta_description`

Knowing that you probably have dome something similar in the past, I would think the "limiter" flag is not enabled for this database engine. The limiter flag says, "Do not do anything that would affect every record in the table without a where clause." If this database engine limiter flag is enabled, then you must add: WHERE 1=1 to the query.

Link to comment
Share on other sites

One of the uses I had hoped to put the description_short to was in the Google_Base feed, so I used description_short in the array in the admin.product.import.format.php hooks file of the module. BUT it does not work properly!

	$header_fields = array('id', 'product_type', 'google_product_category', 'link', 'title', 'description', 'image_link', 'price', 'condition', 'shipping_weight', 'upc', 'ean', 'jan', 'isbn', 'availability', 'brand', 'gtin', 'mpn', 'identifier_exists');
	$fields  = array('product_id', 'store_category', 'google_category', 'url', 'name', 'description_short', 'image', 'price', 'condition', 'product_weight', 'upc', 'ean', 'jan', 'isbn', 'availability', 'manufacturer', 'gtin', 'mpn', 'identifier_exists');

This gives a feed that looks correct in csv, but in Excel I can see that the <p>description_short</p> is NOT filling the correct column. The only thing in the correct column is <p>.

id    product_type    google_product_category    link    title    description    image_link    price    condition    shipping_weight    upc    ean    jan    isbn    availability    brand    gtin    mpn    identifier_exists
2    Advertising    Home & Garden > Kitchen & Dining > Tableware > Drinkware > Mugs    https://dirtybutterestates.com/1957-coca-cola-route-salesman-s-mug-mn.html    1957 COCA-COLA Route Salesman's MUG MN    <p>
    Heavy white mug with a red band around the sides, depicting the salesman&#39;s red, white, and mustard gold 50&#39;s Chevy with the Coca-Cola trademark on the door panels.</p>
    https://dirtybutterestates.com/images/source/cokesalesmanmug042005xxx1.jpg    4.875    used    2.000                    in stock    Houston Harvest            FALSE

Is there some delimiter or such that I need to add to CC code to get this to work? It seemed so simple :(

description_shortscreenshot.thumb.jpg.b6

Edited by Dirty Butter
added screenshot
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...