Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
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
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
Expression in like not working
Remco Schoen
2010-10-21 05:31:34
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
>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
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
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
>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
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
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
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
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap