Newbies herve71 Posted May 23, 2003 Newbies Posted May 23, 2003 hi i try to do an insert or update in FMP database by JDBC with a text contains an apostrophe [color:"red"] INSERT INTO table ("fieldtext") VALUES ('d'abord') the insert failed How can i put my apostrophe in SQL i try URLEncode but in filemaker i don't see the caractere ' in my string somebody have a solution ?
Anatoli Posted May 23, 2003 Posted May 23, 2003 The ('d'abord') must be wrong in all languages. Maybe ("d'abord") or ('d"'"abord') I don't know.
Newbies herve71 Posted May 23, 2003 Author Newbies Posted May 23, 2003 i know it is an example what i try to do i try lot of things to replace ' in the string u0027 or %27 or "'" or ' and many help me
chrisonmaui Posted May 24, 2003 Posted May 24, 2003 insert value "d'abord" should work - you will have to search for that character in some middleware though using something like this: protected static boolean hasEscapeQuotes (String input){ boolean ret = false; String escape = "';,."/"; for (int i =0 ; i < escape.length(); i++){ char test = escape.charAt(i); if (input.indexOf(test) != -1) ret = true; } return ret; } alternatively you can try and use the escape drive properties see page 25 of http://www.filemaker.com.au/downloads/pdf/FMPU55_UltraDev.pdf i find that these properties are poorly implemented ( if at all ) and it is better to write your own class
chrisonmaui Posted May 24, 2003 Posted May 24, 2003 sorry that first method will only work to remove the apostrophes have u tried with prepared statements? the escape characters are handled automatically
omiossec Posted July 20, 2003 Posted July 20, 2003 alternatively you can try and use the escape drive properties see page 25 of http://www.filemaker.com.au/downloads/pdf/FMPU55_UltraDev.pdf The escape property is only use for indentifier (table name, field name ...) not for data. It only use with RAD tools that don't support space or other things in identifier
Recommended Posts
This topic is 7798 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now