Broken support of $ in sql since 9.1.3!?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
a-s-z
Posts: 106
Joined: Wed 03 Dec 2008 06:01

Broken support of $ in sql since 9.1.3!?

Post by a-s-z » Fri 29 Nov 2013 11:19

Hi,

starting with 9.1.3 we have problems updating columns containing a dollar sign. We change the field value, but the field is missing in the update statement!

Problem seems to be located in parsing sql info, because the parser sees column name id$dollar as an expression and not as a field! When using a star instead of concrete names, it works as expected.

See changed code in CRParser.pas ll.759, it seems that handling of $ is missing!?

Code: Select all

create table odac_error_test
(
  id number,
  id$dollar number,
  text varchar2(50 char)
);
insert into odac_error_test values ( 1,1,'1234567890' );
Update failing for Dataset using query:

Code: Select all

select
  id$dollar
  ,id
from odac_error_test
use code like in a test application

Code: Select all

          with OraQuery1, FieldByName('ID$DOLLAR') do
          begin
            Value := 1 + Value;
            Post;
            if CachedUpdates then ApplyUpdates();
          end;
Best regards,
Andre

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Broken support of $ in sql since 9.1.3!?

Post by AlexP » Fri 29 Nov 2013 11:34

Hello,

We have already fixed this problem. This fix will be included in the new version

a-s-z
Posts: 106
Joined: Wed 03 Dec 2008 06:01

Re: Broken support of $ in sql since 9.1.3!?

Post by a-s-z » Fri 29 Nov 2013 11:47

Hi Alex,
AlexP wrote: We have already fixed this problem. This fix will be included in the new version
When you will release next version? Currently we are using 9.1.4

Since this bug may be responsible for other problems we have (Illegal parameter names, sequences with $), can you send me a code patch?

Best regards,
Andre

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Broken support of $ in sql since 9.1.3!?

Post by AlexP » Fri 29 Nov 2013 12:49

Hello,

We plan to release the new version next month. For the time being, to solve the problem, you should redefine the IsAlpha method in the TOraParser class in, as follows:

Code: Select all

  TOraParser = class (TSQLParser)
  ...
  protected
  ...
    function IsAlpha(Ch: char): boolean; override;

...

function TOraParser.IsAlpha(Ch: char): boolean;
begin
  case Ord(Ch) of
    Ord('a')..Ord('z'):
      Result := True;
    Ord('A')..Ord('Z'):
      Result := True;
    Ord('$'):
      Result := True;
    Ord('#'):
      Result := True;
    Ord(#128)..Ord(High(char)):
      Result := True;
    else
      Result := False;
  end;
end;

Post Reply