inserting "{" character and jdbc Escape Syntax
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Java & JDBC Development
I'm trying to insert a character field that contains the '{' character in it. I'm getting a jdbc error java.sql.SQLException: Syntax error in SQL escape clause: Apparently, jdbc thinks I'm trying to use the Escape syntax and is looking for a keyword. How can I successfully insert this character? Thanks! Eric Weaver, Intelihealth epost@intelihealth.com please respond by e-mail and group if possible.
opps! my first response flashed off the screen -- so this may be a duplicate answer... Basically, you must concatenate the symbol into the string to be updated, as follows: update <tablename> set <columnname> = "first part of string"||"}||"second part of string" where 1 = 1 depending on which tool you are using to execute the SQL, you may have to use a different concatenation character... but, the concept is the same. David Russell On Thu, 20 May 1999 11:50:55 -0400, "Eric Weaver" <epost@intelihealth.com> wrote: >I'm trying to insert a character field that contains the '{' character in >it. I'm getting a jdbc error > >java.sql.SQLException: Syntax error in SQL escape clause: > >Apparently, jdbc thinks I'm trying to use the Escape syntax and is looking >for a keyword. How can I successfully insert this character? > >Thanks! > >Eric Weaver, Intelihealth >epost@intelihealth.com > >please respond by e-mail and group if possible. > >
Your solution would cause us to write a lot of custom code. This character can be embedded anywhere in an HTML document. Parsing the data to find this character or characters is not a solution for us. Thanks anyway. David Russell <dbruce@kreative.net> wrote in message news:37449339.6595133@news... > > opps! my first response flashed off the screen -- so this may be a > duplicate answer... > > Basically, you must concatenate the symbol into the string to be > updated, as follows: > > update <tablename> set <columnname> = > "first part of string"||"}||"second part of string" > where 1 = 1 > > depending on which tool you are using to execute the SQL, you may > have to use a different concatenation character... but, the concept is > the same. > > David Russell > > > > > On Thu, 20 May 1999 11:50:55 -0400, "Eric Weaver" > <epost@intelihealth.com> wrote: > > >I'm trying to insert a character field that contains the '{' character in > >it. I'm getting a jdbc error > > > >java.sql.SQLException: Syntax error in SQL escape clause: > > > >Apparently, jdbc thinks I'm trying to use the Escape syntax and is looking > >for a keyword. How can I successfully insert this character? > > > >Thanks! > > > >Eric Weaver, Intelihealth > >epost@intelihealth.com > > > >please respond by e-mail and group if possible. > > > > >