Jump to content
Server Maintenance This Week. ×

Record Export to Multiple Tables (ODBC) Script


This topic is 3397 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm very new to FM Scripting so would be very grateful for any help in getting this off the ground.

 

I have a FM database which I've connected to a MySQL DB via ODBC (Opencart). So far I have one table (Brands) which contain data which I need to populate two tables called oc_manufacturer & oc_url_alias using an automated script.

 

Fields are:

 

Brands::ManufacturerID (e.g 1) - copies RecordID to oc_manufacturer::manufacturer_id

Brands::ManufacturerName (e.g Apple) - Copies the manufacturer name to oc_manufacturer::name

Brands::ManufacturerLogoURL (e.g image/brands/apple/apple-logo.png) - copies the logo url to oc_manufacturer::image

Brands::ManufacturerSortOrder (e.g 1) - copies the sort order to oc_manufacturer::sort_order

 

Creates a New Record ID in oc_url_alias::url_alias_id

Brands::ManufacturerSEOKeyword (e.g apple) - copies SEO keyword to oc_url_alias::keyword

Brands::ManufacturerSEOKeywordQuery - copies SEO keyword query to oc_url_alias::query

 

Any help much appericiated.

 

Thanks

 

J

Link to comment
Share on other sites

Just trying the second part and have come up with this

 

Go to Layout ["Brands" (Brands)]

Set Variable [$ManufacturerSEOKeywordQuery; Brands::ManufacturerSEOKeywordQuery]
Set Variable [$ManufacturerSEOKeyword; Brands::ManufacturerSEOKeyword]
Go to Layout ["oc_url_alias"(oc_url)alias)]
Enter Find Mode []
Set Error Capture [On]
Perform Find []
If [Get (FoundCount) = 0]
New Record/Request
Set Field [oc_url_alias::query; Brands::ManufacturerSEOKeywordQuery]
Set Field [oc_url_alias::keyword; Brands::ManufacturerSEOKeyword]
End If
Go to Layout [original layout]

 

Unfortunately it doesn't seem to work.

Link to comment
Share on other sites

Just trying the second part and have come up with this

 

 

Enter Find Mode []

Set Error Capture [On]

Perform Find []

 

You enter and exit find mode but you are not actually setting any search criteria...

 

Use Set Field[ allias::whatever ; what you are looking for]

one or more of these set fields

Link to comment
Share on other sites

This topic is 3397 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.