Skip to main content
Question

MariaDB (MySQL) in Update Delete Mode

  • September 14, 2020
  • 4 replies
  • 20 views

Forum|alt.badge.img+2

When using the MariaDB/MySQL in either Update or Delete mode, how to you specify the key to match the record? Is it using the fme_where format parameter because there doesn't appear to be mention in the Writer docs.

 

Does it support fme_db_operation also?

4 replies

steveatsafe
Safer
Forum|alt.badge.img+12
  • Safer
  • September 19, 2020

Hi @mark_f​ ,

Thanks for asking this question.

 

I did a quick test in 2020.1 and yes, you'll need to create those two attributes (fme_where, & fme_db_operation) and you must set the writer mode to UPDATE or DELETE for these attributes to be recognized by the feature type writer.

 

Screen Shot 2020-09-18 at 9.24.29 PM

Give it a whirl and let us know if you are still struggling.


anthrax_79
Contributor
Forum|alt.badge.img+4
  • Contributor
  • February 17, 2022

Hi, I am having the same issue. I have followed your settings but getting the error below--- "Unknown Column" . Appreciate your help. FME 

Error executing SQL query ('UPDATE `customer_address` SET `address_id`='540869',`tui`='',`place_id`='40252538UFFL3A8',`location_id`='0035838700TWF8C',`etp`=NULL,`comments`='UNIT LOT 82',`flat_number`='',`street_number`='80',`street_name`='HASS DRIVE',`build_area`='TAURANGA',`u_duct_id`='541497',`date_added`='2021-01-19T17:02:19',`aerial_underground`='underground',`fat_id`='0' WHERE 40252538UFFL3A8=40252538UFFL3A8'): 'Unknown column '40252538UFFL3A8' in 'where clause''

Error executing SQL query ('UPDATE `customer_address` SET `address_id`='540870',`tui`='',`place_id`='40252400UFFL9A4',`location_id`='0035838600TW688',`etp`=NULL,`comments`='UNIT LOT 81',`flat_number`='',`street_number`='78',`street_name`='HASS DRIVE',`build_area`='TAURANGA',`u_duct_id`='541498',`date_added`='2021-01-19T17:02:19',`aerial_underground`='underground',`fat_id`='0' WHERE 40252400UFFL9A4=40252400UFFL9A4'): 'Unknown column '40252400UFFL9A4' in 'where clause''

 

Regards

Lex


danminneyatsaf
Safer
Forum|alt.badge.img+12
anthrax_79 wrote:

Hi, I am having the same issue. I have followed your settings but getting the error below--- "Unknown Column" . Appreciate your help. FME 

Error executing SQL query ('UPDATE `customer_address` SET `address_id`='540869',`tui`='',`place_id`='40252538UFFL3A8',`location_id`='0035838700TWF8C',`etp`=NULL,`comments`='UNIT LOT 82',`flat_number`='',`street_number`='80',`street_name`='HASS DRIVE',`build_area`='TAURANGA',`u_duct_id`='541497',`date_added`='2021-01-19T17:02:19',`aerial_underground`='underground',`fat_id`='0' WHERE 40252538UFFL3A8=40252538UFFL3A8'): 'Unknown column '40252538UFFL3A8' in 'where clause''

Error executing SQL query ('UPDATE `customer_address` SET `address_id`='540870',`tui`='',`place_id`='40252400UFFL9A4',`location_id`='0035838600TW688',`etp`=NULL,`comments`='UNIT LOT 81',`flat_number`='',`street_number`='78',`street_name`='HASS DRIVE',`build_area`='TAURANGA',`u_duct_id`='541498',`date_added`='2021-01-19T17:02:19',`aerial_underground`='underground',`fat_id`='0' WHERE 40252400UFFL9A4=40252400UFFL9A4'): 'Unknown column '40252400UFFL9A4' in 'where clause''

 

Regards

Lex

Hi @Lex Adove​ I believe this issue is arising because you need to use the key attribute's name from your database for the left side of your WHERE clause.

For example: OBJECT ID = @Value(OBJECTID)

In this case OBJECT ID is the name of the key attribute in the database. @Value(OBJECTID) is the attribute in FME that we want to match it to.

 

 In your case you could try a clause such as the following:

'place_id' = @Value(place_id)

 


anthrax_79
Contributor
Forum|alt.badge.img+4
  • Contributor
  • February 18, 2022
danminneyatsaf wrote:

Hi @Lex Adove​ I believe this issue is arising because you need to use the key attribute's name from your database for the left side of your WHERE clause.

For example: OBJECT ID = @Value(OBJECTID)

In this case OBJECT ID is the name of the key attribute in the database. @Value(OBJECTID) is the attribute in FME that we want to match it to.

 

 In your case you could try a clause such as the following:

'place_id' = @Value(place_id)

 

  1. Thanks for your reply. place_id = '@Value(place_id)' worked like a charm. Thanks for your reply and help 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings