7 Replies Latest reply on Jun 20, 2011 10:54 PM by Panky

    Relationship with tables

    YogendraPal

      Title

      Relationship with tables

      Post

      give the query for using primary key and forign key between tables in filemaker pro 11. (please give with example)

        • 1. Re: Relationship with tables
          Kays

          heyy there,

          table Client (idClient, name)

          table project (idProject, IdClient, name)

          in File --> Manage --> Database, (relationship onglet) u need to link the to fields Client::IdClient and Project::IdClient

          in this case if u wanna set a layout to display related records from the two tables

          K|Z

          • 2. Re: Relationship with tables
            YogendraPal
            Hi There ! u r saying right , But Actually i want to Apply Programatically  (using queries , insert query  or update query) filemaker Relationship on FM database. How i do this using queries. Is there any another method (any SDK or API) to do this. pls help me on this, i m waiting for your reply.
            • 3. Re: Relationship with tables
              philmodjunk

              It sounds like you want to manipulate a SQL expression from with in a script to create different relationships between tables. This is not possible in FileMaker. If you give an example of what you are trying to do, we can likely suggest an alternative approach to achieve the same result.

              What you can do is use a script to query a table or group of related tables to bring up a found set of records on a specified layout. This is roughly analogous to a Record Set you might produce in MS Access, for example.

              • 4. Re: Relationship with tables
                YogendraPal

                ok i telling about my problem;

                i m working with FileMaker pro 11  &  m using FM ODBC driver 11.0.81.0

                i create Connection with existing FM database and create a new table in that existing database  using create query this doing right work.

                Table CUSTOMER

                column name characteristic
                SID Primary Key
                Last_Name  varchar
                First_Name  varchar

                my Primary Key syntax is working right but when i fire the Foregin Key syntax then this shows error.

                Eg:CREATE TABLE ORDERS
                      (Order_ID int Primary Key,Order_Date date, Customer_SID int, Foreign Key (Customer_SID) references CUSTOMER(SID));

                In the above example, the Customer_SID column in the ORDERS table is a foreign key pointing to the SID column in the CUSTOMER table.

                then the relation is not creating b/w tables. So what should i do now?

                Is another metho to do this for filemaker database.

                pls help me about this....................Have a nice day.

                • 5. Re: Relationship with tables
                  philmodjunk

                  You are trying to create a new table where? in the source database or in FileMaker? If in FileMaker, don't think this is possible. If in the ODBC source, I don't know--haven't messed with ODBC in FileMaker so don't have a lot of experience in this area to go on.

                  • 6. Re: Relationship with tables
                    YogendraPal

                    thanx for replay....

                    actually my concern is that i want to create relationship by insert and update query with primary key and  forign key.

                    so plse help me to give the query statement for filemaker database.

                    m using FM ODBC driver 11.0.81.0

                    • 7. Re: Relationship with tables
                      Panky

                      Hi PhilMod,

                      I m facing as same type of problem,

                      In Window environment we used ADO and his function for Automation of database.

                      Eg: for creating Relationship in columns for given tables we used CreateRelation() ADO function.

                      Same in this manner on mac how would this will possible,i have no ADO and no API for FileMaker pro 10 and 11 on mac.

                      pls help me about this.

                                                        Have a nice day to you.