Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
Expression in like not working
Remco Schoen
2010-10-21 05:31:34.0
Hello,

I was trying to use an expression on the right hand side of the like operator:
select * from incident where naam like '040' || '002'

This returns this error:
Syntax Error: Can't confirm whether (naam='040')||'002' is a boolean expression.

When I try to use parantheses like this:
select * from incident where naam like ('040' || '002')

I get this error:
Syntax error: Stopped parse at ((id12)

Are expressions supported for the LIKE-operator? In for instance PostgreSQL it is allowed.

With kind regards,

Remco Schoen
Re:Expression in like not working
HXTT Support
2010-10-21 05:49:06.0
>Are expressions supported for the LIKE-operator? I
[NOT] LIKE pattern {escape 'escape_character'},[NOT] ILIKE pattern {escape 'escape_character'}

pattern should be a string value, upper(str),lower(str), or ? paramter. HXTT DBF can utilize index file to quicken some like expression.

|| operator: left string concat right string

I don't know whether PostgreSQL allow variable for pattern. Mabye PostgreSQL allows only string constant operation?
Re:Re:Expression in like not working
Remco Schoen
2010-10-21 06:13:06.0
I tested the statement:
select * from incident where naam like '040' || '002'

in :
* Oracle
* SQL Server
* PostgreSQL
* H2

and all these databases seam to evaluate the expression '040' || '002' to the string '040002' and use that as the pattern for the like.
Re:Re:Re:Expression in like not working
HXTT Support
2010-10-21 06:31:25.0
We can provide such a support. BTW, please list other patterns which you wish to support too,
Re:Re:Re:Re:Expression in like not working
HXTT Support
2010-10-21 20:33:34.0
>select * from incident where naam like '040' || '002'
>select * from incident where naam like ('040' || '002')
Supported now. BTW, please list other patterns which you wish to support too,
Re:Re:Re:Re:Re:Expression in like not working
Remco Schoen
2010-10-22 07:30:50.0
Okay, thanks for supporting this!

We don't have more patterns, that I know off now. We mainly use it like this:
like '%' || 'searchvalue'

and

like '%' || 'searchvalue' || '%'

We use these as database-independent alternatives for functions like starts with (LEFT() = ) and contains (AT).
Re:Re:Re:Re:Re:Re:Expression in like not working
HXTT Support
2010-10-22 19:08:40.0
HXTT DBF supports also LEFT function and $(check whether left string is contained in right string).
Re:Re:Re:Re:Re:Re:Re:Expression in like not working
Remco Schoen
2010-10-26 00:59:21.0
We know that you support these functions, your database is in our case not a problem.

But for instance Oracle doesn't support the LEFT-function and you could use the SUBSTRING-function in that case. MS SQL Server then doesn't support the SUBSTRING-function but the SUBSTR-function.

That's why we went for the like-option.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap