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 PROTECTED]>
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to