Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread TEDBDataSet.filter
Thu, May 3 2007 5:36 PMPermanent Link

"Royke"
We may have found two problems with Dataset.filter expressions that used to
work under the BDE. Both give a #700 error.

dataset.filtered := False;
dataset.filter := '[stringfieldname] = ' + QuotedStr('SomeString');
dataset.filtered := True;

trips over the first '[', message something like 'expression expected, but
'[' found'. It works after taking the square brackets out. Should it not be
possible to use the brackets?

dataset.filtered := False;
dataset.filter := 'booleanfieldname = ' + QuotedStr('True');
dataset.filtered := True;

Again #700, 'Expected Boolean, SmallInt, Integer or BigInt expression, but
instead found 'True' '. This works

dataset.filter := 'booleanfieldname = ' + 'True';

Life ain't easy without Help ...

Roy


Fri, May 4 2007 3:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Royke


In DBISAM V3 both would probably worked. ElevateDB is far stricter about adherence to the standard. Field names surround with double quotes if they have spaces in them otherwise nothing.

A boolean field needs to be compared with a boolean not a string.

You will also find things like field ='' (ie quote quote) is no longer a useful test since '' no longer translates to null

Roy Lambert
Fri, May 4 2007 4:03 AMPermanent Link

"Harry de Boer"
Roy

A boolean cannot be compared to a string. In the filter you can thus use:.

dataset.filter := 'booleanfieldname = TRUE';

Regards, Harry


"Royke" <royke@canada.com> schreef in bericht
news:2FCFF560-4211-466F-9136-44B8C4B144F7@news.elevatesoft.com...
> We may have found two problems with Dataset.filter expressions that used
to
> work under the BDE. Both give a #700 error.
>
> dataset.filtered := False;
> dataset.filter := '[stringfieldname] = ' + QuotedStr('SomeString');
> dataset.filtered := True;
>
> trips over the first '[', message something like 'expression expected, but
> '[' found'. It works after taking the square brackets out. Should it not
be
> possible to use the brackets?
>
> dataset.filtered := False;
> dataset.filter := 'booleanfieldname = ' + QuotedStr('True');
> dataset.filtered := True;
>
> Again #700, 'Expected Boolean, SmallInt, Integer or BigInt expression, but
> instead found 'True' '. This works
>
> dataset.filter := 'booleanfieldname = ' + 'True';
>
> Life ain't easy without Help ...
>
> Roy
>
>
>

Mon, May 7 2007 2:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< dataset.filtered := False;
dataset.filter := '[stringfieldname] = ' + QuotedStr('SomeString');
dataset.filtered := True;

trips over the first '[', message something like 'expression expected, but
'[' found'. It works after taking the square brackets out. Should it not be
possible to use the brackets? >>

Brackets are no longer supported because they are reserved in SQL 2003 for
array declarations and element references, which EDB will have eventually.

<< dataset.filtered := False;
dataset.filter := 'booleanfieldname = ' + QuotedStr('True');
dataset.filtered := True;

Again #700, 'Expected Boolean, SmallInt, Integer or BigInt expression, but
instead found 'True' '. This works

dataset.filter := 'booleanfieldname = ' + 'True'; >>

Boolean literal values cannot be enclosed in quotes.

<< Life ain't easy without Help ... >>

The filter syntax is the same as with SQL expressions, so you should refer
to the SQL manual for this information.  You can find literal value examples
under each of the Types topics here:

http://www.elevatesoft.com/edb1sql_types.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Image