OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
RE: SAPDB 7.4 LIKE pattern matching ranges

From: Zabach, Elke (elke.zabachsap.com)
Date: Fri Jul 04 2003 - 03:27:14 CDT


 Umberto wrote:
>
> Hello,
>
> We are implementing a simple billing system using SAPDB 7.4
> under Linux
> (Redhat 9 and SuSE 8.1) that requires some basic pattern matching with
> ranges.
>
> According to this thread, it supports just what we need:
>
> http://listserv.sap.com/pipermail/sapdb.general/2001-September/008355.html

> However, the range spec doesn't seem to work.
>
> For example, assuming that the table Billing has a record with the value
> '9665277273' in the cNumber column, the following query does not return any
> results:
>
> SELECT * FROM Billing WHERE cNumber LIKE '966(0-5)*'
>
> On the other hand, this does:
>
> SELECT * FROM Billing WHERE cNumber LIKE '9665%'
>
> The latter is not practical since the user would have to query for every
> number between 9660% and 9665% individually.
>
> Am I missing something?

Bad luck. Because of our main customer (our own company) we had to change
the like-predicate according to SQL92-standard, meaning that only
'%' and '_' as written in the docs
http://www.sapdb.org/7.4/htmhelp/8c/ccce27c71c11d2a97100a0c9449261/frameset.htm
are handled starting with 7.4.3.17.

In your example cNumber >= '9660' and cNumber < '9666' could be helpful.
in more complex situations (several ranges in the like-pattern) this will not do,
unfortunately.

Yes, we are thinking of regexp in SAP DB, but no decision made and no timeschedule available.

Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
sapdb.generallistserv.sap.com
http://listserv.sap.com/mailman/listinfo/sapdb.general