Fm11 Odbc JDBC Guide en
Fm11 Odbc JDBC Guide en
Fm11 Odbc JDBC Guide en
Chapter 2
Accessing external SQL data sources
Importing ODBC data 11
Executing SQL to interact with data sources via ODBC 12
Working with ODBC tables in the relationships graph 12
Data sources supported in FileMaker 11 13
Adding ODBC tables to the relationships graph 13
Chapter 3
Installing FileMaker ODBC client drivers
Hardware and software requirements 15
ODBC client driver requirements (Windows) 15
ODBC client driver requirements (Mac OS) 15
Networking requirements 15
ODBC client driver installation (Windows) 15
Configuring client drivers (Windows) 16
ODBC client driver installation (Mac OS) 17
Configuring client drivers (Mac OS) 18
Where to go from here 19
4 FileMaker ODBC and JDBC Guide
Chapter 4
Using ODBC to share FileMaker data
About ODBC 21
Using the ODBC client driver 22
Overview of accessing a FileMaker database file 22
Accessing a FileMaker database file from a Windows application 23
Specifying ODBC client driver properties for a FileMaker DSN (Windows) 23
Verifying access via ODBC (Windows) 24
Accessing a FileMaker database file from a Mac OS application 25
Specifying ODBC client driver properties for a FileMaker DSN (Mac OS) 25
Verifying access via ODBC (Mac OS) 26
Chapter 5
Installing FileMaker JDBC client drivers
Software requirements 27
Networking requirements 27
JDBC client driver installation 27
Using the JDBC client driver 28
Chapter 6
Using JDBC to share FileMaker data
About JDBC 29
Using the JDBC client driver 29
About the JDBC client driver 29
Using a JDBC URL to connect to your database 30
Specifying driver properties in the URL subname 31
Solutions with multiple FileMaker database files 32
Verifying access via JDBC 32
| Contents 5
Chapter 7
Supported standards
Support for Unicode characters 35
SQL statements 35
SELECT statement 35
SQL clauses 36
FROM clause 37
WHERE clause 37
GROUP BY clause 38
HAVING clause 38
UNION operator 38
ORDER BY clause 39
FOR UPDATE clause 39
DELETE statement 42
INSERT statement 42
UPDATE statement 43
CREATE TABLE statement 44
ALTER TABLE statement 44
CREATE INDEX statement 45
DROP INDEX statement 45
SQL aggregate functions 46
SQL expressions 46
Field names 47
Constants 47
Exponential/scientific notation 48
Numeric operators 48
Character operators 48
Date operators 48
Relational operators 49
Logical operators 50
Functions 50
Functions that return character strings 51
Functions that return numbers 53
Functions that return dates 54
Operator precedence 54
ODBC Catalog functions 55
JDBC Meta Data functions 55
Reserved SQL keywords 55
6 FileMaker ODBC and JDBC Guide
Chapter 8
Reference Information
Mapping FileMaker fields to ODBC data types 59
Mapping FileMaker fields to JDBC data types 59
ODBC and JDBC error messages 60
ODBC error messages 60
JDBC error messages 60
Index 61
Chapter 1
Introduction
This guide describes how you can use FileMaker® software as an ODBC client application and as a
data source for ODBC and JDBC applications.
The following table gives an overview of how to use ODBC and JDBC with FileMaker software.
What do you want to do? How do you do it? Product See
1 Use FileMaker software as an 1. Interactively via the relationships graph 1 FileMaker Pro 1 This guide,
ODBC client application. 2. One-time, static via ODBC import or 1 FileMaker Pro Advanced chapter 2.
1 Access ODBC data stored in File menu > Open. Also, the Import 1 FileMaker Server 1 FileMaker
an external SQL data source. Records script step and the Execute SQL Pro Help
script step 1 FileMaker Server Advanced
Using ODBC or JDBC APIs, a client application communicates with a driver manager that identifies the
client driver to communicate with a data source.
Note You cannot modify the schema of external ODBC data sources using FileMaker Pro.
Chapter 2, “Accessing external SQL data sources,” describes how to use FileMaker software as an ODBC
client application.
Chapter 1 | Introduction 9
If your FileMaker database solution uses more than one FileMaker database file, all of the database files
must be on the same computer.
The ODBC and JDBC plug-in components you need for sharing your data with other applications are
installed with FileMaker Server Advanced and FileMaker Pro.
To access a hosted FileMaker database file, you need to install the corresponding ODBC or JDBC client
driver. Install the client driver on the machine where the third-party application is installed.
This guide documents how the ODBC and JDBC client drivers, when used with FileMaker Pro and
FileMaker Server Advanced, support the industry standards for ODBC (Open Database Connectivity),
JDBC (Java Database Connectivity), and SQL (Structured Query Language).
1 Chapter 3, “Installing FileMaker ODBC client drivers,” explains how to install the driver files needed for
accessing a FileMaker data source using ODBC.
1 Chapter 4, “Using ODBC to share FileMaker data,” describes how to use the FileMaker ODBC client
driver to connect to a FileMaker data source from another application.
1 Chapter 5, “Installing FileMaker JDBC client drivers,” explains how to install the driver files needed for
accessing a FileMaker data source using JDBC.
1 Chapter 6, “Using JDBC to share FileMaker data,” describes how to use the FileMaker JDBC client
driver with a Java application or applet that connects to a FileMaker data source.
1 Chapter 7, “Supported standards,” describes the SQL statements that the ODBC and JDBC client drivers
support when used with FileMaker Pro and FileMaker Server Advanced.
Important If you disable ODBC/JDBC sharing after it has already been on, a data source hosted by
FileMaker Server Advanced or FileMaker Pro immediately becomes unavailable. The database
administrator doesn’t have the capability to alert ODBC and JDBC client applications about the data
source’s availability (the administrator can communicate only with FileMaker database file clients). No
errors are reported, and the client application should notify users that the data source is not available and
transactions cannot be completed. If a client application attempts to connect to an unavailable FileMaker
database file, a message explains that the connection failed.
10 FileMaker ODBC and JDBC Guide
Networking requirements
You need a TCP/IP network when using FileMaker Server Advanced to host a FileMaker database file as a
data source over a network. FileMaker Pro supports local access (same computer) only.
Note You have to create a Data Source Name (DSN) for each FileMaker database file you want to access
as a data source. If you have previously set up access through one DSN that allows tables to be spread among
several FileMaker database files, you’ll need to consolidate those tables into a single database file (or create
several DSNs).
Chapter 2
Accessing external SQL data sources
As an ODBC client application, FileMaker software can access data in external SQL data sources.
FileMaker software connects to the external SQL data source using the client driver for the ODBC data
source, and either imports ODBC data or works with ODBC tables in the relationships graph.
Whether you are importing ODBC data or working with ODBC tables in the relationships graph, you must
configure a driver for the ODBC data source you’re using. For example, to access records from an Oracle
database, you configure an Oracle client driver.
After configuring an ODBC client driver, you can interact with records, import records into an existing
FileMaker Pro database file, or create a new FileMaker Pro database file from an ODBC data source (such
as Oracle or Microsoft Access databases).
First, you access the data source you want to import from. Then you construct a query for the records you
want to import from the data source. Finally, if you’re importing data into an existing file, you map fields
from your data source to fields in your FileMaker Pro database file.
You can access your ODBC data source through the File menu, with the Import Records script step, or with
the Execute SQL script step.
To import ODBC data, follow this general process:
1 Install and configure specific ODBC drivers for the external data sources you want to access.
1 On the computer that hosts the current FileMaker Pro file, define a system Data Source Name (DSN) for
each ODBC data source you want to access.
1 Determine any additional considerations for the ODBC data sources you want to access (for example,
whether users are prompted for a user name and password).
12 FileMaker ODBC and JDBC Guide
Note ODBC import, the Execute SQL script step, and external SQL data sources are not supported in
runtime solutions created with FileMaker Pro Advanced.
See FileMaker Pro Help for more information on importing data, using the SQL Query builder dialog box,
and creating FileMaker scripts.
When you use FileMaker Pro or FileMaker Server as the host for a solution that includes ODBC tables in the
relationships graph, you configure the ODBC client driver for the external SQL data source on the host machine.
FileMaker
Pro user
FileMaker Pro
FileMaker or Driver Client
Pro user FileMaker Manager Driver SQL Data
Server host Source
machine
FileMaker
Pro user
See FileMaker Pro Help for detailed steps and additional information on configuring an ODBC client driver,
connecting to ODBC data sources, editing ODBC data sources, and setting up an ODBC table in the
relationships graph.
Chapter 3
Installing FileMaker ODBC client drivers
These instructions help you install the ODBC client driver needed to access FileMaker as a data source from
third-party and custom applications via ODBC (Open Database Connectivity). The ODBC client driver is
available through a separate installation on your FileMaker installation disk or electronic download in the
xDBC folder.
The latest versions of the client drivers are also available from this URL:
www.filemaker.com/support/technologies
If you’ll be hosting a FileMaker database file using FileMaker Server Advanced, make the client drivers
available to remote users.
After installing the client driver you need, you can configure the driver to access a FileMaker data source
and construct SQL (Structured Query Language) queries to interact with the data.
Networking requirements
If you’ll be accessing a FileMaker data source hosted on another computer, you’ll need network access via
TCP/IP.
3. In the xDBC folder, double-click the ODBC Client Driver Installer folder.
4. In the ODBC Client Driver Installer folder, double-click the FMODBC_Installer_Win32.msi file.
The FileMaker ODBC Driver Setup Wizard opens.
5. Install the ODBC client driver by following the on-screen instructions.
Important When using a FileMaker client driver, you must reserve 2399 as the port.
1. In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
1 In Windows XP, Administrative Tools appear in the Performance and Maintenance category.
1 In Windows Vista and Windows 7, Administrative Tools appear in the System and Security category.
The ODBC Data Source Administrator opens.
5. Click Next.
6. For Name, enter a name that will be meaningful to others accessing the FileMaker data source. For
Description, enter an optional description of the FileMaker data source. Click Next.
Chapter 3 | Installing FileMaker ODBC client drivers 17
7. For Host:
1 If you’re connecting to a database file hosted by FileMaker Pro on your local machine, enter localhost
or the IP address 127.0.0.1.
1 If you’re connecting to a database file hosted by FileMaker Server Advanced over a network, enter
the IP address of the FileMaker Server.
If you have enabled sharing via ODBC/JDBC in the host application, you can select Connect to host to
obtain the names of available databases. Click Next.
Otherwise, click Finish to save your data source information.
8. For Database, select a database from the list of available databases, or type the filename of the FileMaker
database file you’re using as a data source.
Note For database files hosted by FileMaker Server Advanced, the list of databases may be filtered based
on the File Display Filter setting. See FileMaker Server Help for information.
If you need special handling of non-English text, click Advanced Language. The Advanced Language
Options dialog box opens.
1 To auto-detect language settings, select the Auto-detect language settings for application option.
1 To specify the language setting, clear the Auto-detect language settings for application option and
select the system setting you want to use.
If you want to create a log file for long-running queries, select the Save long-running queries to a log file
option, and enter the name for the log file.
Click Finish to save your data source information.
Note You cannot change the installation folder for the ODBC client driver.
The ODBC client driver, FileMaker ODBC, is now available for you to configure for accessing a
FileMaker data source.
Important When using a FileMaker client driver, you must reserve 2399 as the port.
1. Launch the ODBC Manager utility. (The ODBC Manager is installed in the Utilities folder in the
Applications folder.)
2. Select the System DSN or User DSN tab, and click Add.
The Choose a driver dialog box opens.
4. Click Continue.
5. For Name, enter a name that will be meaningful to others accessing the FileMaker data source. For
Description, enter an optional description of the FileMaker data source. Click Continue.
Chapter 3 | Installing FileMaker ODBC client drivers 19
6. For Host:
1 If you’re connecting to a database file hosted by FileMaker Pro on your local machine, enter localhost
or the IP address 127.0.0.1.
1 If you’re connecting to a database file hosted by FileMaker Server Advanced over a network, enter
the IP address of the FileMaker Server.
If you have enabled sharing via ODBC/JDBC in the host application, you can select Connect to host to
obtain the names of available databases. Click Continue.
Otherwise, click Finish to save your data source information.
7. For Database, select a database from the list of available databases, or type the filename of the FileMaker
database file you’re using as a data source.
Note For database files hosted by FileMaker Server Advanced, the list of databases may be filtered based
on the File Display Filter setting. See FileMaker Server Help for information.
If you need special handling of non-English text, click Advanced Language. The Advanced Language
Options dialog box opens.
1 To auto-detect language settings, select the Auto-detect language settings for application option.
1 To specify the language setting, clear the Auto-detect language settings for application option and
select the system setting you want to use.
If you want to create a log file for long-running queries, select the Save long-running queries to a log file
option, and enter the name for the log file.
Click Finish to save your data source information.
Note You can also use FileMaker Pro as an ODBC client application, interacting with records from another
data source via ODBC using SQL. See chapter 2, “Accessing external SQL data sources,” for details about
accessing an external SQL data source via ODBC.
About ODBC
ODBC is an API that enables applications to access data from many database management systems. ODBC
gives client applications a common language for interacting with data sources and database services.
All applications that support ODBC recognize a basic subset of SQL (Structured Query Language)
statements. SQL lets you use other applications (such as spreadsheets, word processors, and reporting tools)
to view, analyze, and modify FileMaker data. See chapter 7, “Supported standards,” for the SQL statements,
functions, and expressions that the ODBC client driver supports.
Your application can talk directly to a FileMaker database file by using the ODBC client driver. Your SQL
statements are delivered to the FileMaker host of the database file and the results of those statements are sent
back to you. If you use FileMaker Server Advanced to host a FileMaker database file as a data source, the
database file can be located on another machine (the server machine) connected to the network, while your client
application is located on your machine (the client machine). This is referred to as a client/server configuration.
Client
Application
Driver
Manager
FileMaker
Oracle SQL Server ODBC Client
ODBC Driver ODBC Driver Driver
Microsoft
Oracle SQL Server FileMaker
22 FileMaker ODBC and JDBC Guide
To share a FileMaker database file as a data source, use FileMaker Pro to define accounts that need access to the
database file. Then, control access to the database file by assigning privilege sets to the accounts, including the
extended privilege of access via ODBC/JDBC. Finally, enable the FileMaker Server Advanced or FileMaker Pro
host application to share data via ODBC/JDBC. For details, see FileMaker Pro or FileMaker Server Help.
Important Prior versions of the FileMaker ODBC client driver are not compatible with FileMaker
version 11. To connect to a FileMaker version 11 database file, you need to install and configure the new
ODBC client driver.
Note To confirm that the FileMaker xDBC Listener is currently running, you can use the Activity Monitor
on Mac OS or the Task Manager on Windows to check the status of the FileMaker xDBC Listener process.
When the process is started, it is named fmxdbc_listener, and events are logged by that name. The FileMaker
xDBC Listener process is separate from the FileMaker Server process.
1. In FileMaker Pro, review the privilege sets you’ve assigned to accounts that will access the database file.
Accounts that need access must use a privilege set with the extended privilege of Access via ODBC/JDBC.
2. Enable the FileMaker Server Advanced (via FileMaker Server Admin Console) or FileMaker Pro host
application to share data via ODBC/JDBC.
FileMaker Server Admin Console: Click ODBC/JDBC then select Enable ODBC/JDBC.
FileMaker Pro: Choose File menu > Sharing > ODBC/JDBC and set ODBC/JDBC Sharing to On.
3. Make sure the FileMaker database file you want to access is hosted and available.
If your FileMaker database solution uses more than one FileMaker database file, all of the database files
must be on the same computer.
1. In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
1 In Windows XP, Administrative Tools appear in the Performance and Maintenance category.
1 In Windows Vista and Windows 7, Administrative Tools appear in the System and Security category.
The ODBC Data Source Administrator opens.
2. Select the System DSN or User DSN tab (select the tab used when you previously configured).
4. Click Configure.
The FileMaker DSN Configuration dialog box appears.
5. For Name, enter a name that will be meaningful to others accessing the FileMaker data source. For
Description, enter an optional description of the FileMaker data source. Click Next.
6. For Host, enter the location of your data source.
If you’re connecting to a FileMaker database file hosted by FileMaker Pro on your local machine, type
localhost (or 127.0.0.1).
If you’re connecting to a FileMaker database file hosted by FileMaker Server Advanced over a network,
type the IP address of FileMaker Server.
If you’ve enabled sharing via ODBC/JDBC in the host application, select Connect to host to obtain the
names of available databases.
24 FileMaker ODBC and JDBC Guide
7. For Database, select a database from the list of available databases, or type the filename of the FileMaker
database file you’re using as a data source.
Note For database files hosted by FileMaker Server Advanced, the list of databases may be filtered based
on the File Display Filter setting. See FileMaker Server Help for information.
If you need special handling of non-English text, click Advanced Language. The Advanced Language
Options dialog box opens.
1 To auto-detect language settings, select the Auto-detect language settings for application option.
1 To specify the language setting, clear the Auto-detect language settings for application option and
select the system setting you want to use.
If you want to create a log file for long-running queries, select the Save long-running queries to a log file
option, and enter the name for the log file.
1. In the Windows Control Panel, open Administrative Tools > Data Sources (ODBC).
1 In Windows XP, Administrative Tools appear in the Performance and Maintenance category.
1 In Windows Vista and Windows 7, Administrative Tools appear in the System and Security category.
The ODBC Data Source Administrator opens.
2. Select the System DSN or User DSN tab (select the tab used when you previously configured).
6. Click Test.
You are prompted to enter your FileMaker account name (in Database User Name) and password (in
Database Password).
If the connection is OK, you receive the message Test completed successfully.
If the connection fails:
1 Make sure the FileMaker database file is hosted and available.
1 Update or correct your connection information.
Chapter 4 | Using ODBC to share FileMaker data 25
1 Make sure your FileMaker account uses a privilege set with the extended privilege of Access via ODBC/
JDBC.
1 Verify that the FileMaker Pro or FileMaker Server host application has been set up for sharing via
ODBC/JDBC.
1. Launch the ODBC Manager utility. (The ODBC Manager is installed in the Utilities folder in the
Applications folder.)
4. Click Configure.
The FileMaker DSN Configuration dialog box opens.
5. Click Continue.
6. For Name, type a name that will be meaningful to others accessing the FileMaker data source.
An additional Description is optional.
8. For Database, select a database from the list of available databases, or type the filename of the FileMaker
database file you’re using as a data source.
Note For database files hosted by FileMaker Server Advanced, the list of databases may be filtered based
on the File Display Filter setting. See FileMaker Server Help for information.
If you need special handling of non-English text, click Advanced Language. The Advanced Language
Options dialog box opens.
1 To auto-detect language settings, select the Auto-detect language settings for application option.
1 To specify the language setting, clear the Auto-detect language settings for application option and
select the system setting you want to use.
If you want to create a log file for long-running queries, select the Save long-running queries to a log file
option, and enter the name for the log file.
10. Click Done to close the FileMaker DSN Configuration dialog box.
1. Launch the ODBC Manager utility. (The ODBC Manager is located in the Utilities folder in the
Applications folder.)
2. Select the System DSN or User DSN tab (select the tab used when you previously configured).
4. Click Configure.
The FileMaker DSN Configuration dialog box opens.
5. Click Continue until you recheck the Conclusion page.
6. Click Test.
You are prompted to enter your FileMaker account name (in Database User Name) and password (in
Database Password).
If the connection is OK, you receive the message Test completed successfully.
If the connection fails:
1 Make sure the FileMaker database file is hosted and available.
1 Update or correct your connection information.
1 Make sure your FileMaker account uses a privilege set with the extended privilege of Access via ODBC/
JDBC.
1 Verify that the FileMaker Pro or FileMaker Server host application has been set up for sharing via
ODBC/JDBC.
Chapter 5
Installing FileMaker JDBC client drivers
These instructions help you install the client driver needed to access FileMaker as a data source from third-
party and custom applications via JDBC (Java Database Connectivity). The client driver is available on your
FileMaker DVD or electronic download in the xDBC folder. The latest versions of the client drivers are also
available from this URL:
www.filemaker.com/support/technologies
If you’ll be hosting a FileMaker database file using FileMaker Server Advanced, make the client drivers
available to remote users.
After installing the client driver you need, you can configure the driver to access a FileMaker data source
and construct SQL (Structured Query Language) queries to interact with the data.
The JDBC client driver is the driver portions of the FileMaker software that allow third-party applications
or custom applications to access FileMaker files as JDBC data sources.
Software requirements
To install and use the JDBC client drivers, you need JDK 1.4 or later.
To find which version of Java you’re running, open a command window (Windows) or Terminal window
(Mac OS) and type java -version.
Networking requirements
If you’ll be accessing a FileMaker data source hosted on another computer, you’ll need network access via
TCP/IP.
3. In the xDBC folder, double-click the JDBC Client Driver Installer folder.
28 FileMaker ODBC and JDBC Guide
4. Copy the fmjdbc.jar file to the appropriate folder for your operating system:
1 Windows: Copy the fmjdbc.jar file to the folder that includes your Java executable file (java.exe) or
to another folder location included in the ClassPath of your Java application.
1 Mac OS: Copy the fmjdbc.jar file to the /Library/Java/Extensions folder or to another folder location
included in the ClassPath of your Java application.
The JDBC client driver is now available for you to use to access a FileMaker data source.
Important You must reserve the port 2399 for the FileMaker JDBC client driver. The port number is always
2399. You can’t change the JDBC sharing to a different port.
For more information on using the JDBC client driver, see chapter 6, “Using JDBC to share FileMaker data.”
Chapter 6
Using JDBC to share FileMaker data
If you’re a Java programmer, you can use the JDBC client driver with any Rapid Application Development
(RAD) tool to visually create a Java application or applet that connects to a FileMaker data source. The Java
application or applet that uses the JDBC client driver can directly access the data in a FileMaker database file.
About JDBC
JDBC is a Java API for executing SQL statements, the standard language for accessing relational databases.
JDBC is a name and not an acronym — although it is thought of as standing for “Java Database Connectivity”
because it is the Java equivalent for ODBC. JDBC is a low-level interface, which means that it is used to call
SQL commands directly. It is also designed to be used as a base for higher level interfaces and tools.
Your Java applet or application can talk directly to a FileMaker database file by using the JDBC client driver.
Your SQL statements are delivered to the FileMaker host of the database file and the results of those
statements are sent back to you. If you use FileMaker Server to host, the FileMaker database file you’re
using as a data source can be located on another machine (the server machine) connected to the network,
while your Java applet or client application is located on your machine (the client machine). This is referred
to as a client/server configuration.
Java application
Important The JDBC client driver replaces the FileMaker JDBC driver released with a previous version of
FileMaker. If you have previously set up access to a FileMaker data source using the older driver, you’ll
need to re-define access by using and configuring the new driver.
Note To confirm that the FileMaker xDBC Listener is currently running, you can use the Activity Monitor
on Mac OS or the Task Manager on Windows to check the status of the FileMaker xDBC Listener process.
When the process is started, it is named fmxdbc_listener, and events are logged by that name. The FileMaker
xDBC Listener process is separate from the FileMaker Server process.
Registering the JDBC client driver and connecting to a FileMaker data source (an example)
Here is a snippet of a JDBC client application that:
1. Registers the JDBC client driver with the JDBC driver manager.
2. Establishes a connection with the FileMaker data source. The JDBC URL is
jdbc:filemaker://192.168.1.1/database
Chapter 6 | Using JDBC to share FileMaker data 31
JDBC URL connection with the database name specified in the URL
Format:
jdbc:filemaker://<filemaker host IP address>/<databasename>
Example:
jdbc:filemaker://192.168.1.1/publications
JDBC URL connection with the database name, user name, and password specified in the URL
Format:
jdbc:filemaker://<filemaker host IP address>/
<databasename>?user=<databaseusername>&password=<databasepassword>
Example:
jdbc:filemaker://192.168.1.1/customers?user=Collections&password=admin
Note Because of the use of the ampersand character (&) in this syntax, you cannot use an ampersand
character in the user name or the password.
For additional information on using JDBC to share FileMaker data, see www.filemaker.com/support/technologies.
34 FileMaker ODBC and JDBC Guide
Chapter 7
Supported standards
This chapter describes the SQL statements and constructs supported by the FileMaker ODBC and JDBC
client drivers. Use the client drivers to access a FileMaker database solution from an ODBC- or JDBC-
compliant application. The FileMaker database solution can be hosted by either FileMaker Pro or
FileMaker Server Advanced.
The ODBC client driver supports ODBC 3.5 Level 1 with some features of Level 2. The JDBC client driver
provides partial support for the JDBC 3.0 specification. See www.filemaker.com/support/technologies for
more information. The ODBC and JDBC client drivers support SQL-92 entry-level conformance, with some
SQL-92 intermediate features.
SQL statements
The ODBC and JDBC client drivers provide support for the following SQL statements:
SELECT (see below) DELETE (page 42) INSERT (page 42) UPDATE (page 43)
CREATE TABLE (page 44) ALTER TABLE (page 44) CREATE INDEX (page 45) DROP INDEX (page 45)
The client drivers also support FileMaker data type mapping to ODBC SQL and JDBC SQL data types. See
“Mapping FileMaker fields to ODBC data types” on page 59 and “Mapping FileMaker fields to JDBC data
types” on page 59 for data type conversions. For more information on constructing SQL queries, refer to a
third-party book.
Note The ODBC and JDBC client drivers do not support FileMaker portals.
SELECT statement
Use the SELECT statement to specify which columns you're requesting. Follow the SELECT statement with
the column expressions (similar to field names) you want to retrieve (for example, last_name).
Expressions can include mathematical operations or string manipulation (for example, SALARY * 1.05).
36 FileMaker ODBC and JDBC Guide
SQL clauses
The ODBC and JDBC client drivers provide support for the following SQL clauses.
Use this SQL clause To
FROM (page 37) Indicate which tables are used in the SELECT statement.
WHERE (page 37) Specify the conditions that records must meet to be retrieved (like a FileMaker Pro find request).
GROUP BY (page 38) Specify the names of one or more fields by which the returned values should be grouped. This clause
is used to return a set of aggregate values by returning one row for each group (like a FileMaker Pro
subsummary).
HAVING (page 38) Specify conditions for groups of records (for example, display only the departments that have
salaries totaling more than $200,000).
UNION (page 37) Combine the results of two or more SELECT statements into a single result.
ORDER BY (page 39) Indicate how the records are sorted
FOR UPDATE (page 39) To perform Positioned Updates or Positioned Deletes via SQL cursors
Note If you attempt to retrieve data from a table with no columns, the SELECT statement returns nothing.
Chapter 7 | Supported standards 37
FROM clause
The FROM clause indicates the tables that are used in the SELECT statement. The format is:
FROM table_name [table_alias] [, table_name [table_alias]]
table_name is the name of a table in the current database.
table_alias can be used to give the table a more descriptive name, to abbreviate a longer table name, or
to include the same table in the query more than once (for example, in self-joins).
Field names can be prefixed with the table name or the table alias. For example, given the table specification
FROM employee E, you can refer to the LAST_NAME field as E.LAST_NAME. Table aliases must be
used if the SELECT statement joins a table to itself. For example:
SELECT * FROM employee E, employee F WHERE E.manager_id = F.employee_id
The equal sign (=) includes only matching rows in the results.
If you are joining more than one table, and you want to discard all rows that don’t have corresponding rows
in both source tables, you can use INNER JOIN. For example:
SELECT *
FROM Salespeople INNER JOIN Sales_Data
ON Salespeople.Salesperson_ID = Sales_Data.Salesperson_ID
If you are joining two tables, but you don’t want to discard rows of the first table (the “left” table), you can
use LEFT JOIN.
SELECT *
FROM Salespeople LEFT JOIN Sales Data
ON Salespeople.Salesperson ID = Sales Data.DepartmentID
Every row from the “Salespeople” table will appear in the joined table.
If you are joining two tables, but you don’t want to discard rows of the second table (the “right” table), you
can use RIGHT JOIN.
SELECT *
FROM Salespeople RIGHT JOIN Sales Data
ON Salespeople.Salesperson ID = Sales Data.DepartmentID
Every row from the “Sales Data” table will appear in the joined table.
Notes
1 LEFT JOIN is supported, but the grammar LEFT OUTER JOIN is not currently supported.
1 RIGHT JOIN is supported, but the grammar RIGHT OUTER JOIN is not currently supported.
1 FULL OUTER JOIN is not currently supported.
WHERE clause
The WHERE clause specifies the conditions that records must meet to be retrieved. The WHERE clause
contains conditions in the form:
WHERE expr1 rel_operator expr2
expr1 and expr2 can be field names, constant values, or expressions.
rel_operator is the relational operator that links the two expressions. For example, the following
SELECT statement retrieves the names of employees who make $20,000 or more.
SELECT last_name,first_name FROM emp WHERE salary >= 20000
38 FileMaker ODBC and JDBC Guide
Note If you use fully qualified names in the SELECT (projection) list, you must also use fully qualified
names in the related WHERE clause.
GROUP BY clause
The GROUP BY clause specifies the names of one or more fields by which the returned values should be
grouped. This clause is used to return a set of aggregate values. It has the following format:
GROUP BY columns
columns must match the column expression used in the SELECT clause. A column expression can be one
or more field names of the database table separated by commas.
The following example sums the salaries in each department.
SELECT dept_id, SUM (salary) FROM emp GROUP BY dept_id
This statement returns one row for each distinct department ID. Each row contains the department ID and
the sum of the salaries of the employees in the department.
HAVING clause
The HAVING clause enables you to specify conditions for groups of records (for example, display only the
departments that have salaries totaling more than $200,000). It has the following format:
HAVING expr1 rel_operator expr2
expr1 and expr2 can be field names, constant values, or expressions. These expressions do not have to
match a column expression in the SELECT clause.
rel_operator is the relational operator that links the two expressions. The following example returns only
the departments whose sums of salaries are greater than $200,000:
SELECT dept_id, SUM (salary) FROM emp
GROUP BY dept_id HAVING SUM (salary) > 200000
UNION operator
The UNION operator combines the results of two or more SELECT statements into a single result. The
single result is all of the returned records from the SELECT statements. By default, duplicate records are
not returned. To return duplicate records, use the ALL keyword (UNION ALL). The format is:
SELECT statement UNION [ALL] SELECT statement
When using the UNION operator, the select lists for each SELECT statement must have the same number
of column expressions, with the same data types, and must be specified in the same order. For example:
SELECT last_name, salary, hire_date FROM emp UNION SELECT name, pay,
birth_date FROM person
This example has the same number of column expressions, and each column expression, in order, has the
same data type.
The following example is not valid because the data types of the column expressions are different (SALARY
from EMP has a different data type than LAST_NAME from RAISES). This example has the same number
of column expressions in each SELECT statement, but the expressions are not in the same order by data type.
SELECT last_name, salary FROM emp UNION SELECT salary, last_name FROM raises
Chapter 7 | Supported standards 39
ORDER BY clause
The ORDER BY clause indicates how the records are to be sorted. The format is:
ORDER BY {sort_expression [DESC | ASC]}, ...
sort_expression can be field names, expressions, or the positional number of the column expression to
use. The default is to perform an ascending (ASC) sort.
For example, to sort by last_name then by first_name, you could use either of the following SELECT
statements:
SELECT emp_id, last_name, first_name FROM emp ORDER BY last_name, first_name
or
SELECT emp_id, last_name, first_name FROM emp ORDER BY 2,3
In the second example, last_name is the second column expression following SELECT, so ORDER BY 2
sorts by last_name.
Additional examples:
Using Sample SQL
text constant SELECT 'CatDog' FROM Salespeople
Retrieving the contents of a container field: CAST() function and GetAs() function
You can retrieve binary data, file reference information, or data of a specific file type from a container field.
To retrieve binary data, use a standard SELECT statement. For example:
SELECT Company_Brochures FROM Sales_Data
If file or JPEG data exists, the SELECT statement retrieves the data in binary form; otherwise, the SELECT
statement returns <null>.
Chapter 7 | Supported standards 41
To retrieve file reference information from a container field, such as the file path to a file, picture, or
Quicktime movie, use the CAST function with a SELECT statement. For example:
SELECT CAST(Company_Brochures AS VARCHAR(NNN)) FROM Sales_Data
In this example, if you:
1 Inserted a file into the container field using FileMaker Pro but stored only a reference to the file, the
SELECT statement retrieves the file reference information as type SQL_VARCHAR.
1 Inserted the contents of a file into the container field using FileMaker Pro, the SELECT statement
retrieves the name of the file.
1 Imported a file into the container field from another application, the SELECT statement displays '?' (the
file displays as Untitled.dat in FileMaker Pro).
To retrieve data from a container field, use the GetAs function and specify the file’s type depending on how
the data was inserted into the container field in FileMaker Pro.
1 If the data was inserted using the Insert > File command, specify 'FILE' in the GetAs function. For
example:
SELECT GetAs(Company_Brochures, 'FILE') FROM Sales_Data
1 If the data was inserted using the Insert > Sound command (Standard sound — Mac OS raw format),
specify 'snd' in the GetAs function. For example:
SELECT GetAs(Company_Meeting, 'snd ') FROM Company_Newsletter
1 If the data was inserted using the Insert > Object command (OLE container data), specify 'EMBO' in the
GetAs function. For example:
SELECT GetAs(Company_Results, 'EMBO') FROM Annual_Report
1 If the data was inserted using the Insert > Picture command, drag and drop, or paste from the clipboard,
specify one of the file types listed in the following table. For example:
SELECT GetAs(Company_Logo, 'JPEG') FROM Company_Icons
DELETE statement
Use the DELETE statement to delete records from a database table. The format of the DELETE statement is:
DELETE FROM table_name [ WHERE { conditions } ]
Note The WHERE clause determines which records are to be deleted. If you don’t include the WHERE
keyword, all records in the table are deleted (but the table is left intact).
INSERT statement
Use the INSERT statement to create records in a database table. You can specify either:
1 A list of values to be inserted as a new record
1 A SELECT statement that copies data from another table to be inserted as a set of new records
Note In container fields, you can INSERT text only, unless you prepare a parameterized statement and
stream the data from your application. To use binary data, you must specify the type in a PutAs() function:
PutAs(col, ‘type’), where the type value is a type as described in “Retrieving the contents of a
container field: CAST() function and GetAs() function” on page 40.
The SELECT statement is a query that returns values for each column_name value specified in the column
name list. Using a SELECT statement instead of a list of value expressions lets you select a set of rows from
one table and insert it into another table using a single INSERT statement.
Chapter 7 | Supported standards 43
UPDATE statement
Use the UPDATE statement to change records in a database table. The format of the UPDATE statement is:
UPDATE table_name SET column_name = expr, ... [ WHERE { conditions } ]
column_name is the name of a column whose value is to be changed. Several columns can be changed in
one statement.
expr is the new value for the column.
Usually the expressions are constant values for the columns (but they can also be a subquery). You must
enclose character string values in pairs of single quotation marks ('). To include a single quotation mark in
a character string value enclosed by single quotation marks, use two single quotation marks together (for
example, 'Don''t').
Subqueries must be enclosed in parentheses.
The WHERE clause is any valid clause. It determines which records are updated.
An example of an UPDATE statement on the Employee table is:
UPDATE emp SET salary=32000, exempt=1 WHERE emp_id = 'E10001'
The UPDATE statement changes every record that meets the conditions in the WHERE clause. In this case
the salary and exempt status are changed for all employees having the employee ID E10001. Because
employee IDs are unique in the Employee table, only one record is updated.
Here's an example using a subquery:
UPDATE emp SET salary = (SELECT avg(salary) from emp) WHERE emp_id = 'E10001'
In this case, the salary is changed to the average salary in the company for the employee having employee
ID E10001.
Note In container fields, you can UPDATE with text only, unless you prepare a parameterized statement
and stream the data from your application. To use binary data, you must specify the type in a PutAs()
function: PutAs(col, ‘type’), where the type value is a type as described in “Retrieving the contents
of a container field: CAST() function and GetAs() function” on page 40.
44 FileMaker ODBC and JDBC Guide
Examples
Using Sample SQL
text column CREATE TABLE T1 (C1 VARCHAR, C2 VARCHAR (50), C3 VARCHAR (1001), C4 VARCHAR
(500276))
text column, NOT NULL CREATE TABLE T1NN (C1 VARCHAR NOT NULL, C2 VARCHAR (50) NOT NULL, C3 VARCHAR
(1001) NOT NULL, C4 VARCHAR (500276) NOT NULL)
numeric column CREATE TABLE T2 (C1 DECIMAL, C2 DECIMAL (10,0), C3 DECIMAL (7539,2),
C4 DECIMAL (497925,301))
Examples
To Sample SQL
add columns ALTER TABLE Salespeople ADD C1 VARCHAR
set the default value for a ALTER TABLE Salespeople ALTER Company SET DEFAULT ‘FileMaker’
column
remove the default value for ALTER TABLE Salespeople ALTER Company DROP DEFAULT
a column
Note SET DEFAULT and DROP DEFAULT do not affect existing rows in the table, but change the default
value for rows that are subsequently added to the table.
Example
CREATE INDEX ON Salespeople.Salesperson_ID
Example
DROP INDEX ON Salespeople.Salesperson_ID
Examples
Aggregate function Returns
SUM The total of the values in a numeric field expression. For example, SUM(SALARY) returns the sum
of all salary field values.
AVG The average of the values in a numeric field expression. For example, AVG(SALARY) returns the
average of all salary field values.
COUNT The number of values in any field expression. For example, COUNT(NAME) returns the number of
name values. When using COUNT with a field name, COUNT returns the number of non-null field
values. A special example is COUNT(*), which returns the number of records in the set, including
records with null values.
MAX The maximum value in any field expression. For example, MAX(SALARY) returns the maximum
salary field value.
MIN The minimum value in any field expression. For example, MIN(SALARY) returns the minimum
salary field value.
SQL expressions
Use expressions in WHERE, HAVING, and ORDER BY clauses of SELECT statements to form detailed
and sophisticated database queries.Valid expression elements are:
Field names Numeric operators Relational operators
Constants Character operators Logical operators
Exponential notation Date operators Functions
Chapter 7 | Supported standards 47
Field names
The most common expression is a simple field name, such as calc or Sales_Data.Invoice_ID.
Constants
Constants are values that do not change. For example, in the expression PRICE * 1.05, the value 1.05 is a
constant. Or you might assign a value of 30 to the constant Number_Of_Days_In_June.
You must enclose character constants in pairs of single quotation marks ('). To include a single quotation
mark in a character constant enclosed by single quotation marks, use two single quotation marks together
(for example, 'Don''t').
FileMaker accepts the ODBC/JDBC format date, time, and timestamp constants in braces ({}), for example:
1 {D '2010-06-05'}
1 {T '14:35:10'}
1 {TS '2010-06-05 14:35:10'}
FileMaker also accepts SQL-92 syntax ISO date and time formats with no braces:
1 DATE 'YYYY-MM-DD'
1 TIME 'HH:MM:SS'
1 TIMESTAMP 'YYYY-MM-DD HH:MM:SS'
Constant Acceptable syntax (examples)
Text 'Paris'
Number 1.05
Date DATE '2010-06-05'
{ D '2010-06-05' }
{06/05/2010}
{06/05/10}
Note: The 2-digit year syntax is not supported for the ODBC/JDBC format or the SQL-92 format.
Time TIME '14:35:10'
{ T '14:35:10' }
{14:35:10}
Timestamp TIMESTAMP '2010-06-05 14:35:10'
{ TS '2010-06-05 14:35:10'}
{06/05/2010 14:35:10}
{06/05/10 14:35:10}
Make sure Strict data type: 4-Digit Year Date is not selected as a validation option in the FileMaker
database file for a field using this 2-digit year syntax.
Note: The 2-digit year syntax is not supported for the ODBC/JDBC format or the SQL-92 format.
When entering date and time values, match the format of the database file locale. For example, if the
database was created on an Italian language system, use Italian date and time formats.
48 FileMaker ODBC and JDBC Guide
Exponential/scientific notation
Numbers can be expressed using scientific notation.
Example
SELECT column1 / 3.4E+7 FROM table1 WHERE calc < 3.4E-6 * column2
Numeric operators
You can include the following operators in number expressions: +, -, *, /, and ^ or ** (exponentiation).
You can precede numeric expressions with a unary plus (+) or minus (-).
Character operators
You can concatenate characters.
Examples
In the following examples, last_name is 'JONES ' and first_name is 'ROBERT ':
Operator Concatenation Example Result
+ Keep trailing blank characters first_name + last_name 'ROBERT JONES '
- Move trailing blank characters to the end first_name - last_name 'ROBERTJONES '
Date operators
You can modify dates.
Examples
In the following examples, hire_date is {D '2008-30-01'}.
Operator Effect on date Example Result
+ Add a number of days to a date hire_date + 5 {D '2008-02-04'}
- Find the number of days between two dates, or hire_date - {D '2008-01-01'} 29
subtract a number of days from a date hire_date - 10 {D '2008-01-20'}
Additional examples:
SELECT Date_Sold, Date_Sold + 30 AS agg FROM Sales_Data
SELECT Date_Sold, Date_Sold - 30 AS agg FROM Sales_Data
Chapter 7 | Supported standards 49
Relational operators
Operator Meaning
= Equal
<> Not equal
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
LIKE Matching a pattern
NOT LIKE Not matching a pattern
IS NULL Equal to Null
IS NOT NULL Not equal to Null
BETWEEN Range of values between a lower and upper bound
IN A member of a set of specified values or a member of a subquery
NOT IN Not a member of a set of specified values or a member of a subquery
EXISTS ‘True’ if a subquery returned at least one record
ANY Compares a value to each value returned by a subquery (operator must be preceded by =, <>, >, >=,
<, or <=); =Any is equivalent to In
ALL Compares a value to each value returned by a subquery (operator must be preceded by =, <>, >, >=,
<, or <=)
Examples
SELECT Sales_Data.Invoice_ID FROM Sales_Data
WHERE Sales_Data.Salesperson_ID = 'SP-1'
SELECT Sales_Data.Amount FROM Sales_Data WHERE Sales_Data.Invoice_ID <> 125
SELECT Sales_Data.Amount FROM Sales_Data WHERE Sales_Data.Amount > 3000
SELECT Sales_Data.Time_Sold FROM Sales_Data
WHERE Sales_Data.Time_Sold < '12:00:00'
SELECT Sales_Data.Company_Name FROM Sales_Data
WHERE Sales_Data.Company_Name LIKE '%University'
SELECT Sales_Data.Company_Name FROM Sales_Data
WHERE Sales_Data.Company_Name NOT LIKE '%University'
SELECT Sales_Data.Amount FROM Sales_Data WHERE Sales_Data.Amount IS NULL
SELECT Sales_Data.Amount FROM Sales_Data WHERE Sales_Data.Amount IS NOT NULL
SELECT Sales_Data.Invoice_ID FROM Sales_Data
WHERE Sales_Data.Invoice_ID BETWEEN 1 AND 10
SELECT COUNT(Sales_Data.Invoice_ID) AS agg
FROM Sales_Data WHERE Sales_Data.INVOICE_ID IN (50,250,100)
SELECT COUNT(Sales_Data.Invoice_ID) AS agg
FROM Sales_Data WHERE Sales_Data.INVOICE_ID NOT IN (50,250,100)
SELECT COUNT(Sales_Data.Invoice_ID) AS agg FROM Sales_Data
WHERE Sales_Data.INVOICE_ID NOT IN (SELECT Sales_Data.Invoice_ID
FROM Sales_Data WHERE Sales_Data.Salesperson_ID = 'SP-4')
50 FileMaker ODBC and JDBC Guide
SELECT *
FROM Sales_Data WHERE EXISTS (SELECT Sales_Data.Amount
FROM Sales_Data WHERE Sales_Data.Salesperson_ID IS NOT NULL)
SELECT *
FROM Sales_Data WHERE Sales_Data.Amount = ANY (SELECT Sales_Data.Amount
FROM Sales_Data WHERE Sales_Data.Salesperson_ID = 'SP-1')
SELECT *
FROM Sales_Data WHERE Sales_Data.Amount = ALL (SELECT Sales_Data.Amount
FROM Sales_Data WHERE Sales_Data.Salesperson_ID IS NULL)
Logical operators
You can combine two or more conditions. The conditions must be related by AND or OR, such as:
salary = 40000 AND exempt = 1
The logical NOT operator is used to reverse the meaning, such as:
NOT (salary = 40000 AND exempt = 1)
Examples
SELECT * FROM Sales_Data WHERE Sales_Data.Company_Name
NOT LIKE '%University' AND Sales_Data.Amount > 3000
SELECT * FROM Sales_Data WHERE (Sales_Data.Company_Name
LIKE '%University' OR Sales_Data.Amount > 3000)
AND Sales_Data.Salesperson_ID = 'SP-1'
Functions
FileMaker SQL supports many functions you can use in expressions. Some of the functions return characters
strings, some return numbers, and some return dates.
Chapter 7 | Supported standards 51
TRIM Removes leading and trailing blanks from a string TRIM(' ABC ') returns 'ABC'
LTRIM Removes leading blanks from a string LTRIM(' ABC') returns 'ABC'
SUBSTR Returns a substring of a string, with parameters of the SUBSTR('Conrad',2,3) returns 'onr'
SUBSTRING string, the first character to extract, and the number of SUBSTR('Conrad',2) returns 'onrad'
characters to extract (optional)
SPACE Generates a string of blanks SPACE(5) returns ' '
STRVAL Converts a value of any type to a character string STRVAL('Woltman') returns 'Woltman'
STRVAL(5 * 3) returns '15'
STRVAL(4 = 5) returns 'False'
STRVAL({D '2008-12-25'})
returns '2008-12-25'
TIME Returns the time of day as a string At 9:49 PM, TIME() returns 21:49:00
TIMEVAL
USERNAME Returns the login ID specified at connect time
USER
Note The TIME() function is deprecated. Use the SQL standard CURRENT_TIME instead.
Examples
SELECT CHR(67) + SPACE(1) + CHR(70) FROM Salespeople
SELECT RTRIM(' ' + Salespeople.Salesperson_ID) AS agg FROM Salespeople
SELECT TRIM(SPACE(1) + Salespeople.Salesperson_ID) AS agg FROM Salespeople
SELECT LTRIM(' ' + Salespeople.Salesperson_ID) AS agg FROM Salespeople
SELECT UPPER(Salespeople.Salesperson) AS agg FROM Salespeople
SELECT LOWER(Salespeople.Salesperson) AS agg FROM Salespeople
SELECT LEFT(Salespeople.Salesperson, 5) AS agg FROM Salespeople
SELECT RIGHT(Salespeople.Salesperson, 7) AS agg FROM Salespeople
SELECT SUBSTR(Salespeople.Salesperson_ID, 2, 2) +
SUBSTR(Salespeople.Salesperson_ID, 4, 2) AS agg FROM Salespeople
52 FileMaker ODBC and JDBC Guide
SELECT SUBSTR(Salespeople.Salesperson_ID, 2) +
SUBSTR(Salespeople.Salesperson_ID, 4) AS agg FROM Salespeople
SELECT SPACE(2) + Salespeople.Salesperson_ID AS Salesperson_ID FROM
Salespeople
SELECT STRVAL('60506') AS agg FROM Sales_Data WHERE Sales_Data.Invoice = 1
53 FileMaker ODBC and JDBC Guide
DAYOFWEEK Returns the day of week (1-7) of a date expression DAYOFWEEK({d '2004/05/01'})
returns 7
MOD Divides two numbers and returns the remainder of the MOD(10,3) returns 1
division
EXP Returns a value that is the base of the natural logarithm (e)
raised to a power specified by the argument
FLOOR Returns the largest integer value that is less than or equal to
the argument
HOUR Returns the hour part of a value.
INT Returns the integer part of a number INT(6.4321) returns 6
Functions that
return numbers Description Example
SIGN An indicator of the sign of the argument: -1 for negative, 0
for 0, and 1 for positive.
SIN Returns the sine of the argument
SQRT Returns the square root of the argument
TAN Returns the tangent of the argument
VAL Converts a character string to a number; if the character VAL('123') returns 123
string is not a valid number, returns 0
X Returns the decimal equivalent of a hexadecimal number X'b9' returns 185
YEAR Returns the year part of a date YEAR({d '2010/01/30'}) returns 2010
Note The DATE() function is deprecated. Use the SQL standard CURRENT_DATE instead.
Operator precedence
As expressions become more complex, the order in which the expressions are evaluated becomes important.
This table shows the order in which the operators are evaluated. The operators in the first line are evaluated
first, and so on. Operators in the same line are evaluated left to right in the expression.
Precedence Operator
1 Unary '-', Unary '+'
2 ^, **
3 *, /
4 +, -
5 =, <>, <, <=, >, >=, Like, Not Like, Is Null, Is Not Null, Between, In, Exists, Any, All
6 Not
7 AND
8 OR
Chapter 7 | Supported standards 55
For example, the following Create Table statement shows how to use the "OID" keyword as a data element name.
create table t ("oid" numeric)
SESSION_USER USAGE
SET USER
SIZE USERNAME
SMALLINT USING
SOME VALUE
SPACE VALUES
SQL VARBINARY
SQLCODE VARCHAR
SQLERROR VARYING
SQLSTATE VIEW
STRVAL WHEN
SUBSTRING WHENEVER
SUM WHERE
SYSTEM_USER WITH
TABLE WORK
TEMPORARY WRITE
THEN YEAR
TIME ZONE
TIMESTAMP
TIMESTAMPVAL
TIMEVAL
TIMEZONE_HOUR
TIMEZONE_MINUTE
TO
TODAY
TRAILING
TRANSACTION
TRANSLATE
TRANSLATION
TRIM
TRUE
UNION
UNIQUE
UNKNOWN
UPDATE
UPPER
USAGE
USER
USERNAME
USING
58 FileMaker ODBC and JDBC Guide
Chapter 8
Reference Information
String length is optional in table declarations. All strings are stored and retrieved in Unicode.
The JDBC client driver converts the FileMaker calculation data type to the JDBC SQL type matching the
calculation’s result. For example, the JDBC client driver converts a FileMaker calculation that results in a
timestamp data type to java.sql.Types.TIMESTAMP.
DEGREES function 53 H
DELETE (SQL statement) 42
HAVING (SQL clause) 38
disabling a shared FileMaker database file 9
holdable cursor 29
DISTINCT operator 36
host, DSN 23, 25
driver properties
HOUR function 53
JDBC client driver 31
ODBC client driver (Mac OS) 25
ODBC client driver (Windows) 23 I
drivers image files in container fields 41
uninstalling old 10 IN operator 49
DROP INDEX (SQL statement) 45 INNER JOIN 37
DSNs INSERT (SQL statement) 42
creating (Mac OS) 25 installation requirements 15, 27
creating (Windows) 23 INT function 53
one per file 10 IS NOT NULL operator 49
IS NULL operator 49
E
empty string J
use in SELECT 40
Java Development Kit (JDK) 30
error message formats 60
Java version 27
EXISTS operator 49
JDBC
EXP function 53 client driver, described 29
exponential notation in SQL expressions 48 described 29
expressions in SQL 46 error messages 60
extended privileges 22 overview of using 7
JDBC client driver
F driver class and main entry point 30
field names in SQL expressions 47 mapping data types 59
meta data functions 55
fields
portals 35
mapping to JDBC 59
registering with the JDBC driver manager 30
mapping to ODBC 59
specifying the JDBC URL 30
FileMaker products 9 Unicode support 35
files verifying access 32
organizing on one computer 9 JDBC SPI 30
setting up access to 22
join 37
use in container fields 41
FLOOR function 53
K
FOR UPDATE (SQL clause) 39
FROM (SQL clause) 37 keywords, reserved SQL 55
FULL OUTER JOIN 37
functions in SQL expressions 50 L
LEFT function 51
G LEFT JOIN 37
GetAs function 41, 59 LEFT OUTER JOIN 37
GROUP BY (SQL clause) 38 LEN function 53
LIKE operator 49
literals in SQL expressions 47
LN function 53
| Index 63
T
table aliases 36, 37
TAN function 54
testing access
JDBC client driver 32
ODBC client driver (Mac OS) 26