Jump to content
Sign in to follow this  
tomentourage

Querying a filemaker db with SQL

Recommended Posts

Hi, I am in the process of building a databse in access and I've been told that filemaker would be much better solution. I am fairly used to SQL server 2012 so one of my main concerns is being able to write SQL to manipulate my data and build the relationships and keys etc. Is this all done in a GUI in filemaker? I know it can be connected to SQL server or oracle but (forgive my ignorance of filemaker) why would I need filemaker, other than to build something at the front end. If I could just make selections without a full functionaly in filemaker I think this would be ok for this project. If anyone has any comments that would be great!

 

Thanks 

Share this post


Link to post
Share on other sites
Kris M    33

In FileMaker you use a GUI for building tables / cols / relationships.

You also use a GUI for building layouts for user interaction with the data layer.

It's a distinctly different paradigm than Access or SQL Server so consider the learning curve as a significant part of the equation.

In a simplified description FM is a development environment where gui is bound to data layer and a scripting language knits the two together to facilitate building functionality for the user.

Using FM as a strictly front end tool for a SQL back end can be done but is probably not the best choice as performing CRUD transactions or finds/sorts with SQL as a back end on large data sets will cause performance issues.

Not saying you shoudn't do it but I would not approach this as a beginner.

IMHO making a decision on any development platform after a brief introduction and no platform SME at the table is more about what is the team comfortable with than anything else. Furthermore making a platform decision based on a coworker suggestion is equally fraught with risk.

Edited by Kris M

Share this post


Link to post
Share on other sites
Wim Decorte    446

FMI actually actively warns against using FM as nothing but a front-end to an ESS SQL database.

As to creating tables through SQL: sure, FM supports that.  But not setting up relationships.  That is done through the FM UI

Share this post


Link to post
Share on other sites
Kris M    33

As i said - "It's a distinctly different paradigm than Access or SQL Server so consider the learning curve as a significant part of the equation."

SQL Queries are part of the learning curve/paradigm shift as the relationships graph in FM can be thought of as a gui based query builder.

Edited by Kris M

Share this post


Link to post
Share on other sites

OK, thanks, a final related question, is that gui basis as flexible as writing queries, i.e. can make selections that are as specific as a written query ?

Share this post


Link to post
Share on other sites
comment    1,369

can you make selections from the database using queries?

Yes and no. You can make SQL selections using SQL queries. You cannot create a Filemaker found set using an SQL query - at least not directly. Filemaker supports a limited set of SQL, but it's not an SQL database at its core.

 

OK, thanks, a final related question, is that gui basis as flexible as writing queries, i.e. can make selections that are as specific as a written query ?

Yes.

Edited by comment

Share this post


Link to post
Share on other sites
Oliver Reid    0

FMI actually actively warns against using FM as nothing but a front-end to an ESS SQL database.

As to creating tables through SQL: sure, FM supports that.  But not setting up relationships.  That is done through the FM UI

Actually, the point here I believe, is that FMP is not the best tool for executing high volumes of transactions form many users to a SQL database. However when same workgroup needs to work with large volumes of data, and updates are infrequent I have found " FM as nothing but a front-end to an ESS SQL database."  to be a very effective approach, for several reasons

-- Searches can be very much faster

-- Complex calculations and /or aggregations across many tables,  can be very fast using views set up in SQL. You create views that provide "Virtual Flat Tables" of aggregate values. Dramatically fast vs native FM - especially over a WAN.

-- Publishing SQL to the web is very scalable using PHP or other tools, and subcontractors to do this are easy to find.

So in a  write "a few times an hour" read "millions of times", scenario ESS is in fact brilliant.

 

You do have to learn (by experience, unfortunately) the behavior of "Flush Cached External Data" - I have found that to be certain that you are looking at the most current data this has to be done in the "context" of each table that could have been updated - not just in the layout you are looking at. A bit cumbersome.

Tools expressly designed for SQL front-ending deal with things like this,  and also avoiding "collisions" where multiple users are trying to write to the same record, much better.

Share this post


Link to post
Share on other sites

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

Sign in to follow this  

  • Similar Content

    • By losferwords@outgun.com
      I've been working with SQL databases for about 12 years now, and have stumbled across this monstrosity in a new position - and I really don't get the translation between Filemaker and SQL.
       
      This should work according to the documentation:
      ExecuteSQL ( " SELECT Customer_EVENT::Inv_dollars )  FROM Customer_Event WHERE Customer_EVENT::FlagReview = \" " ; "" ; "" )
      ...or something. I really can't even get a simple SQL Statement just pulling anything more than 1 field to work. Is there a reference out there (not Filemaker or FM14 Bible) that actually explains in detail WHY FQL statements are made the way they are and how each piece interacts?
      I'm not sure I can do this with a calculation, but it's entirely possible. I'm just trying to get a SUM on a certain set of records to display SOMEWHERE in a layout. The fields are from a related table, but have nothing to do with the related records. It's just a way to SUM the objects in a portal by "filtering" the amount.
       
       
    • By Hrcap
      Greetings All
       
      I am looking to add a line into the following code into the 'prepare payload for client' section to select only records that match the following criteria
      I have a variable set called: $additional_settings The field that needs to match with $additional_settings is called _kf_uuid_companys the code that i have already is as follows, i need to add a line into this code to pick records where the field _kf_uuid_companys matches $additional Settings.
      Any help would be greatly appreciated:
       
      "SELECT "
      & $dyn_sql & ", '"
      & $$record_delimiter & "'"
      & " FROM \\"" & $sync_table & "\\""
      & " WHERE " &
       
       
       
      // Exclude records flagged for sync exclusion.
      "( COALESCE ( BS_Exclude, 0 ) = 0 ) " &
       
       
       
       
      // If the client is merging new/updated data with data already on the device...
      // Only include records that have been added/updated since the last pull...
      // And only include data that they did not just push (i.e. no "round tripping!")...
       
      If ( ( $$sync_method = "Merge" )
      and
      ( $last_pull_utc > 0 ) ;
       
      "AND ( BS_UTC_Time > " & $last_pull_utc & " ) " &
       
      "AND ( COALESCE ( BS_Device_ID, 'X' ) <> '" & $client_persistent_id & "') "; "" )
    • By sal88
      Hi all
      I'm trying to find the Client that has the most Job time over the last 30 days, divided by the number of seats that they have. The tables are:
      Clients
      Client_ID, Seats
      Jobs
      Client_IDF, Job_time, Job_Date
      The best I've managed so far is to find the distinct Client_IDF from all Jobs:
      ExecuteSQL ( "SELECT DISTINCT j.log_client_IDF FROM Jobs J WHERE j.Log_date >= ?"; ""; "";  $date_30_days_ago) And then loop through the list and perform the 'divide by seats' calculation for each line
      Or to do something similar but from the Clients table:
      ExecuteSQL ( "SELECT SUM (j.labour_units), c.Name FROM Clients C JOIN Jobs J ON j.log_client_IDF = c.Client_ID WHERE l.Log_date >= ?"; ""; ""; $date_30_days_ago) But no joy in either case when it comes to actually performing calculations within SQL.
      Is this possible in FM SQL?
      Many thanks
    • By Mark Stuller
      Hello
      We are going to take the plunge and setup a sync between our Oracle tables and 'shadow' FileMaker tables and we're seeking input.
      One thing we are wondering about is a 'one-way' sync. We don't want changes to be sync'd back to Oracle. The bigger issue is that we don't want deletions in the Oracle table to be deleted in the FileMaker table. There often are children to these records we don't want deleted or orphaned.
      As well, are there any gotchas we should consider? I've read the Advanced topics and feel mostly comfortable but you never know what you don't know!
      Thanks, Mark
    • By scain101
      I need some help with ExecuteSQL.

      I have a TO “Sales” that is related to Estimates, Inspections, and Proposals via ID_SALES:id_sales.

      I created some simple ExecuteSQL calculations that work on Estimates and Inspections, but the same calculations will not work with the related Proposals TO. 

      ·         I know that the relationship is good because I can get the SUM and COUNT from Proposals with a basic calculation (not ExecuteSQL).

      ·         I know there is not a problem with the name on the related Proposals TO (like a space between words). I've copied and pasted the working calculations and I have started from scratch, and neither works.

      This statement works:

      ExecuteSQL ( "SELECT COUNT

      (ID_ESTIMATES) FROM TO40_ESTIMATES

      WHERE ID_SALES = ? “ ;

      "" ; "" ;

      TO13_sales_ESTIMATES||id_sales::id_sales )

      ---

      This statement does not work:

      ExecuteSQL ( " SELECT COUNT

      (ID_PROPOSAL) FROM TO26_PROPOSALS

      WHERE ID_SALES = ? ";

       "" ; "" ;

      TO13_sales_PROPOSALS||id_sales::id_sales)


       
      Any help would be appreciated.

      SC

×

Important Information

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