• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Escape character question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escape character question


  • Subject: Re: Escape character question
  • From: Ismael Perdido <email@hidden>
  • Date: Mon, 24 Oct 2005 21:35:28 +0200 (CEST)

Sacha,

Good tips, though not causing the problem.  The query
works fine in postgres.  The error is thrown by the
JDBC adaptor it would seem.


 --- Sacha Michel Mallais <email@hidden>
escribió:

> On Oct 24, 2005, at 12:00 PM, Ismael Perdido wrote:
> >
> > I am having trouble sending a 'like' operator
> query
> > from WO5.2.3 to Postgresql8 (also installed
> project
> > wonder).  It apparently bombs on the escape
> character
> > being used by default ('\').
> >
> > Is there a way to modify this character or work
> around
> > it WITHOUT  having to use the EOAdaptorChannel to
> send
> > the SQL directly to the server?  Below is the
> error.
> > Any advice would be greatly appreciated.
> >
> > com.webobjects.jdbcadaptor.JDBCAdaptorException:
> > EvaluateExpression failed:
> > <com.webobjects.jdbcadaptor.JDBCExpression:
> "SELECT
> > t0.address, t0.city, t0.email1, t0.fullname,
> > t0.grade_id, t0.password, t0.phone1,
> RTRIM(t0.state),
> > t0.u_id, t0.zip FROM public.userinfo t0 WHERE
> > UPPER(t0.fullname) LIKE UPPER(?) ESCAPE '\'"
> > withBindings: 1:"%o%"(fullname)>:
> >     Next exception:SQL State:42601 -- error code:
> 0 --
> > msg: ERROR: unterminated quoted string at or near
> > "'\'"
>
> I'm not a Postgres expert, but it looks to me like
> it is not properly
> quoting the column names, which causes problems when
> you have column
> names that are the same as keywords, for example
> "password".  One way
> that I use to debug stuff like this is to copy and
> paste that SQL
> directly into the SQL interpreter.  Then you can
> quickly try various
> permutations and see what's actually happening.
>
> On a separate issue, it looks like you're using
> caseInsensitiveLike,
> and it also looks like that ends up using UPPER.
> That will work but
> it cannot use the index, so your query will be
> slower than you might
> otherwise suspect.
>
>
> sacha
>
>
> --
> Sacha Michel Mallais             Senior Developer /
> President
> Global Village Consulting Inc.
> http://www.global-village.net/
> PGP Key ID: 7D757B65             AIM: smallais
>
>
>
>



______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, más seguridad
http://correo.yahoo.es
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Escape character question (From: Sacha Michel Mallais <email@hidden>)

  • Prev by Date: Re: Escape character question
  • Next by Date: Re: Escape character question
  • Previous by thread: Re: Escape character question
  • Next by thread: Re: Escape character question
  • Index(es):
    • Date
    • Thread