ODBC Driver with MySQL Question

I'm trying to decide if using ODBC will be helpful for a small project I just got. What I've been doing up to now is programmatically creating CSV files and importing those. Using this roundabout technique, I get the level of control I need in Filemaker.

However, using ODBC, what I think is correct is that I have two choices:

  1. ODBC import or
  2. Doing some kind of SQL that would update MySQL (in this case).

So, what I want to do is run a query and get the value of that SELECT statement and use that (say, from a SET VARIABLE statement) to update a field. I don't have any MySQL tables in the relationship graph.

Note: Trying to add a table to the RG doesn't work either since at least the Actual driver expects you to have a primary key before you can add a table to the RG (MySQL doesn't impose this restriction). Thus, this table (which I cannot modify as it's client data) can not, as I see it, be added to the RG.

Am I confused or is ODBC too limited for what I'm trying to do?

Thanks.

1 Like

See the following FileMaker Help page: Claris FileMaker Pro 19 Help: Accessing external data sources.

Hope this helps.

1 Like

You're right, you have the Import script step for get data into filemaker and the Execute SQL script step for pushing data to the sql-db if you don't add it as external source.
If your query just returns a single value, use a global field as import target and then post process the field value.
For multiple values (rows, columns) you'd need a table to import to, or create a stored procedure on the sql-db, that returns the result as a text/json object, call it with the Import step into a global and post process the result.
I do quite a bit this way with mssql-dbs, works rock solid.
I use also the sp/import construct to create/sync records to the sql-db, getting the primary keys of the sql-tables back for later updates/deletes.

best
Otmar

1 Like

Thanks Otmar.

Yeah, I'll stick with my current approach since it's free and really doesn't take very much time -- just an intermediate CSV creation. I was just hoping ODBC work for my case.

Great reply, thanks again.

Import from ODBC/Execute SQL is definitely the most flexible and fastest way.
Some valuable tricks here.

2 Likes

Do you know how to remove/un-install the "Actual" ODBC driver? I wrote the company for instructions but they never replied.
Thanks.

The drivers get installed in /Library/ODBC, there are also two config files odbc.ini and odbcinst.ini at the same location, just remove the actual parts from them.

1 Like

I'm worried that if I go removing items from /Library/ODBC that the machine might have a problem. Are you sure this will work? Have you done it yourself? Thanks.

I haven't done it, but don't see any danger for the machine. Just zip the ODBC content before so you can go back. As long you don't use a odbc connection, those drivers do nothing.

1 Like

Thanks man! :slight_smile:

The Actual drivers come with an installer/ configuration tool. All you need to do is complete the fields. The installer includes connectivity tests. No headache, It just works.

1 Like

I didn't see that. I was just install. No options. Could you be referring to a previous version?
I tried unchecking all the drivers and running the installer, but that didn't do anything - all the drivers were still in /Library/ODBC.
Thanks

I haven’t installed for a year or two. Maybe things have changed. Seems like big step backwards n convenience.

Thanks Malcolm. :slight_smile:

You can grab ODBC Manager for 64 bit systems here:

or use this one:
http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads#Stable%20Version%203.52.15

both provide GUI functions for adding/removing connections/drivers.

yikes...this site doesn't even have HTTPS. :frowning:
Thanks,