TMSScript & division sign

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Saupg
Posts: 19
Joined: Wed 05 Nov 2008 11:53

TMSScript & division sign

Post by Saupg » Wed 26 Jun 2013 07:38

Hello!

I found strange bug - i can't use division sign ('/') if it is only one at line.
I get "syntax error".
Simple example:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  MSConnection: TMSConnection;
  MSScript: TMSScript;
begin
  MSConnection := TMSConnection.Create(Self);
  MSScript := TMSScript.Create(Self);
  try
    MSConnection.Authentication := auWindows;
    MSConnection.Server := 'db01';
    MSConnection.Database := 'master';
    MSConnection.LoginPrompt := False;

    MSScript.Connection := MSConnection;
    MSScript.SQL.Text := 'SELECT'#10#13 +
      '(10'#10#13 +
      '/'#10#13 +     // This line with error!
      '2) AS RES';
    MSScript.Execute;
  finally
    MSScript.Free;
    MSConnection.Free;
  end;
end;
p.s.> I try to migrate from SDAC 5 to SDAC 6 Trial before buy it. Please help.

AndreyZ

Re: TMSScript & division sign

Post by AndreyZ » Wed 26 Jun 2013 10:23

Hello,

Thank you for the information. We have reproduced the problem and investigation of the problem is in progress. As soon as we have any results we will let you know.

AndreyZ

Re: TMSScript & division sign

Post by AndreyZ » Thu 11 Jul 2013 06:43

We have investigated this problem. The point is that when there is only the '/' character in the line, it is considered as a delimiter. To avoid the problem, you should not leave the '/' character alone in the line. Here is en example:

Code: Select all

MSScript.SQL.Text := 'SELECT (10 / 2) AS RES';
MSScript.Execute;

Saupg
Posts: 19
Joined: Wed 05 Nov 2008 11:53

Re: TMSScript & division sign

Post by Saupg » Fri 12 Jul 2013 05:24

AndreyZ, thanks for reply.

I'm using SDAC 5 now and my project has many sql queries with single '/' in one line. It works!
"10" and "2" values from my example are big sub-queries in my project and single '/' symbol in one line used for readability.

AndreyZ

Re: TMSScript & division sign

Post by AndreyZ » Fri 12 Jul 2013 07:29

Please specify the exact version of SDAC 5 you are using now (for example, 5.10.0.7). You can learn it from the About sheet of TMSConnection Editor.

Post Reply