Depending on what tool you are using, the dots will get you into big trouble. For most compliant SQL engines the dot has special meaning, separating qualifiers. If you don't want that to be the case, try putting double quotes around the fields that contain embedded dots in them, including the table name. That might do the trick, so I would start with this:
SELECT "EMAIL.ADDRESS", "LEN.OF.KEY", Q1, Q2, Q3, Q4, PRIORITY, "SIC.CODE", "SLS.NO", "CUST.NO", "CUST.NAME", "TERRITORY.REP", "PRIMARY.PHONE" FROM "EMAIL.CX" WHERE "EMAIL.ADDRESS" = '$fromEmail' or (DOMAIN = '$fromDomain' and "DOMAIN.FLAG" = 'Y') ORDER BY "LEN.OF.KEY" DESC; Disclaimer: I'm an ANSI SQL programmer (wrote the Liberty SQL engine) but don't really know UV JDBC's level of compliance. Void where prohibited. Your mileage may vary! :) -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of John Hester Sent: Friday, April 23, 2010 4:29 PM To: U2 Users List Subject: [U2] UV JDBC SQL syntax We have a call center server doing queries against UV via JDBC, and are having trouble with one of the queries. I'm not a SQL syntax expert, but this query is OK as far as I can tell: SELECT EMAIL.ADDRESS, LEN.OF.KEY, Q1, Q2, Q3, Q4, PRIORITY, SIC.CODE, SLS.NO, CUST.NO, CUST.NAME, TERRITORY.REP, PRIMARY.PHONE FROM EMAIL.CX WHERE EMAIL.ADDRESS = '$fromEmail' or (DOMAIN = '$fromDomain' and DOMAIN.FLAG = 'Y') ORDER BY LEN.OF.KEY DESC; Can anyone else see any problems there? TIA, John _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
