Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL: Single quote embedded in string?

Featured Replies

I'm using FMPro JDBC to communicate between my Filemaker databases and my Java program. I am trying to INSERT into the database, and some of my strings have single quotes in them. I wrote a method to change all single quotes in any string to two single quotes, which is suposed to be interpreted as an embedded single quote, rather than as the quote ending the string. This worked fine when I used the jdbc-odbc driver from Sun. However, now I can't get it to work. I get the following error message:

java.sql.SQLException: [5] Invalid Command - INSERT INTO "ProblemLists1.fp5" ("UniqueID", "ListPosition", "Type", "Name", "CoreName", "LabTestName", "TestSetting", "Notes", "ShowNotes", "Indent", "Checked") VALUES ('test18', 1, 'D', 'port wine urine', 'null3', 'COLOR', 'Abnormal', 'I don''t know if this''ll work or not.', 'true', 2, 'false')

I tried surrounding all of my strings in the VALUES list with double quotes, and only having a single quote inside the string, but that didn't work either. In fact, doing it that way, I got an error message even when there was no single quote in any of the strings:

java.sql.SQLException: [5] Invalid Command - INSERT INTO "ProblemLists1.fp5" ("UniqueID", "ListPosition", "Type", "Name", "CoreName", "LabTestName", "TestSetting", "Notes", "ShowNotes", "Indent", "Checked") VALUES ("test18", 0, "M", "New Mechanism", "null0", "", "", "", "false", 0, "false")

All is fine if I use single quotes to surround the string, and no single quotes inside them. Any suggestions how I get the embedded single quote to work? I sure don't want to disallow my users from using them!

Thanks,

Pam

  • 2 months later...
  • Newbies

Hi Pam,

Sorry, I don't have an answer for your question but another question for you. You seem to be the first developer I could find that is actually using JDBC with Filemaker. We are trying to develop a JAVA application with access to Filemaker but no one seems to know even what we would need (developer edition? FM 6 unlimited?)

We tried to access via ODBC and the FM 6 Demo version and a simple SELECT statement takes about 1 minute per record (!!!!)

So does the JDBC work? Is there documentation? What do we need to buy? Should we give up??? We don't want to!!!!

Thanks,

Markus

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.