Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 36 total
Thread Problem with UPPER()
Mon, Aug 25 2014 4:39 PMPermanent Link

Mark Shapiro

Could someone with DBISAM 4.39 build 2 please check the UPPER() function and verify that it is not producing uppercase characters in a DBISAMQuery with code like this:

SELECT item_name, UPPER(item_name) as CapName FROM CustIntake

Mark Shapiro
infocus@swbell.net
Tue, Aug 26 2014 3:57 AMPermanent Link

Matthew Jones

Mark Shapiro wrote:

> Could someone with DBISAM 4.39 build 2 please check the UPPER()
> function and verify that it is not producing uppercase characters in
> a DBISAMQuery with code like this:
>
> SELECT item_name, UPPER(item_name) as CapName FROM CustIntake

Hmm, it works in 4.33, but I don't want to install 4.39 to test if it's
broken!

--

Matthew Jones
Tue, Aug 26 2014 1:53 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/25/2014 4:39 PM, Mark Shapiro wrote:
> Could someone with DBISAM 4.39 build 2 please check the UPPER() function and verify that it is not producing uppercase characters in a DBISAMQuery with code like this:
> SELECT item_name, UPPER(item_name) as CapName FROM CustIntake
>

This works correct for me on 4.39 Build 2.

How exactly is the "item_name" declared - in my case just a string size 10.

Raul

Tue, Aug 26 2014 2:49 PMPermanent Link

Mark Shapiro

Raul,

Thank you for your reply. All of the fields are of type String with lengths of 12 to 60 characters. Using the Database System Utility, UPPER() produces the desired results. With a DBISAMQuery component, it does not. I should also mention this is occurring with the Delphi 7 version of the DBISAM components.

Mark Shapiro
infocus@swbell.net
Tue, Aug 26 2014 3:07 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/26/2014 2:49 PM, Mark Shapiro wrote:
> Thank you for your reply. All of the fields are of type String with lengths of 12 to 60 characters. Using the Database System Utility, UPPER() produces the desired results. With a DBISAMQuery component, it does not. I should also mention this is occurring with the Delphi 7 version of the DBISAM components.

In my case it's on D2007 but otherwise sounds like similar setup.

Where exactly are you seeing the issue - can you show snippet of code ?

Sounds like you might be referring to the non-upper column still when
getting the value : i.e. not using something like

DBISAMQuery1.FieldByName('CapName').AsString

Raul
Wed, Aug 27 2014 3:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mark


The point Raul forgot to make is that DBSys is "just" another Delphi program. I don't know which version of Delphi Tim uses for it these days (it used to be D5 I think) but unless there are problems with DBISAM between versions of Delphi (unlikely) if it works in DBSys and not your code then the problem is generally in your code.

Try this:

Just before you open the query in your code add in a showmessage(dbisamquery.sql.text) then when the message shows click on it, ctrl-a, ctrl-c and paste that chunk of sql into DBSys. That way, with the exception of parameters, you'll be comparing the exact code you're using in your code.

Roy Lambert
Wed, Aug 27 2014 1:55 PMPermanent Link

Mark Shapiro

Roy & Raul,

What makes this so odd is that the code couldn't be simpler and produces the same result in similar queries against 22 other tables:

SELECT item_name, UPPER(item_name) as CapName FROM CustIntake

I've massaged this every way I can and am left with one conclusion: the UPPER() function is failing to capitalize in a DBISAMQuery component at version 4.39 Build 2 for Delphi 7. I am awaiting Tim's re-appearance in the forums so he can test the code at his end.

Mark Shapiro
infocus@swbell.net
Wed, Aug 27 2014 3:52 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/27/2014 1:55 PM, Mark Shapiro wrote:
> What makes this so odd is that the code couldn't be simpler and produces the same result in similar queries against 22 other tables:
>
> SELECT item_name, UPPER(item_name) as CapName FROM CustIntake

I understand it's simple but post the snippet of the code that fails for
you as well as actual table schema (for the columns involved) so we all
can try same code - as i said my version of the code works fine for both
D2007 and XE6 (and in DBSYS so that covers D5 i think).

Code i'm running (that works fine) is :

DBISAMQuery1.SQL.Text := 'select item_name,UPPER(item_name) as CapName
from TESTTBL';
DBISAMQuery1.Open;
while DBISAMQuery1.Eof=FALSE do
begin
  memo1.Lines.Add( DBISAMQuery1.FieldByName('item_name').AsString + '
and  ' +
      DBISAMQuery1.FieldByName('CapName').AsString);
  DBISAMQuery1.Next;
end;


> I've massaged this every way I can and am left with one conclusion: the UPPER() function is failing to capitalize in a DBISAMQuery component at version 4.39 Build 2 for Delphi 7. I am awaiting Tim's re-appearance in the forums so he can test the code at his end.

It's possible but would be a very rare issue considering source code is
same and at least 2-3 other versions work fine of the same version.

I'd still double-check your table field defs and code etc.

As to Tim - you should email support direct for quicker response.

Raul
Wed, Aug 27 2014 4:45 PMPermanent Link

Mark Shapiro

Raul,

ANY code I use with UPPER() does not capitalize the result.

UtilityDS.Close;
UtilityDS.SQL.Clear;
UtilityDS.SQL.Add('SELECT interest_name, UPPER(interest_name) as CapName FROM  VolunteerInterestCat');
UtilityDS.SQL.Add('GROUP BY CapName');
UtilityDS.SQL.Add('ORDER BY CapName NOCASE');
UtilityDS.Open;

"interest_name" is a 45 character String field.

Here is the output from this routine:

Children's Program, Children's Program
Phone bank, Phone bank
Public speaking, Public speaking

I posted an incident report on August 17th and have not heard a word in response. I'm working on a deadline with an old version of Delphi and need to get this issue resolved by the first week in September.

Mark Shapiro
infocus@swbell.net
Wed, Aug 27 2014 10:25 PMPermanent Link

Raul

Team Elevate Team Elevate

On 8/27/2014 4:45 PM, Mark Shapiro wrote:

Mark,

> ANY code I use with UPPER() does not capitalize the result.

My colleague reminded me that we have an old D7 VM around here that we
once used for migration.

I found it and it still works. It's D7 (build 4.453) never patched but
that should not really matter in this case.

I installed DBISAM 4.39 Build 2  and created a sample table with the 3
of your entries (interest_name is defined as string 45) and here is the
code i ran :

  memo1.Clear;
  DBISAMQuery1.SQL.Add('SELECT interest_name, UPPER(interest_name) as
CapName FROM  TESTTBL');
  DBISAMQuery1.SQL.Add('GROUP BY CapName');
  DBISAMQuery1.SQL.Add('ORDER BY CapName NOCASE');
  DBISAMQuery1.Open;
  while DBISAMQuery1.Eof=FALSE do
  begin
    memo1.Lines.Add( DBISAMQuery1.FieldByName('interest_name').AsString
+ ' ,  ' +
      DBISAMQuery1.FieldByName('CapName').AsString);
      DBISAMQuery1.Next;
  end;

and here is the output from the memo:

Children's Program ,  CHILDREN'S PROGRAM
Phone Bank ,  PHONE BANK
Public Speaking ,  PUBLIC SPEAKING


Everything looks as expected to me.

Let me know if there is anything else i can try.

Raul
Page 1 of 4Next Page »
Jump to Page:  1 2 3 4
Image