Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted (edited)

I am trying to import data from a MySQL database and need to somehow also import fieldnames to be the fieldname in FMP. Is there anyway to do that? I have a CSV of the fieldnames and I also have a MySQL dump of fieldnames and associated data.

Thanks for any help.

Edited by mountainx
Posted

If you have a .csv file that contains field names in the first row and data in the other rows, you can import it into a new table and designate the first row to be used as the source for field names in the new table.

 

Posted

What about an existing table? If I deleted the old fields that corresponded to "last year's data", can I append the fields to an already existing table?

Posted

Well actually, we use this database once a year for a yearly survey so the fieldnames in the survey each year are unique - survey_numberXgroup_numberXquestion_number. So last year's data has absolutely no relevance and get deleted. It may be wrong, but it is the way it was designed. IS that still a no?

Posted
3 minutes ago, mountainx said:

the fieldnames in the survey each year are unique

It makes no difference. Adding data to a table should not require a change in schema. You should have a permanent set of fields that includes a field to store the year, if necessary.

In any case, it is not possible to change a table's schema programmatically. At least not from within Filemaker (it may be possible using a third-party application that connects to Filemaker via ODBC or JDBC).

 

  • 2 months later...
Posted

Hi,

hope it’s not to late to answer.

It really seems to make no sense to have new field names each year for the same kind of data.

If you can somehow create fields that you can reuse each year, then the following would be my suggestion:

Since you seem to know SQL, I would suggest FileMaker’s Execute SQL function. With a free plugin (SQL Runner from Dracoventions; super great product, btw.) you can do INSERT INTO as you wish.

The steps would be: 1) Paste SQL DUMP into a text field. 2) In a script, read line after line of the text field and put the data of each line into $Variables. 3) Using the Execute SQL script step you can easily INSERT INTO the lines into your FileMaker data base.

Hope this helps,

Gary

This topic is 1552 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.