Hello!
To make my queries stored in TZQuery or loaded runtime from text files more understandable in the future I leave comments in them.
Comment /* */ works fine, but two minuses -- for commenting to end of line seems to be not working.
Especially when parameters with colon : are included in the query.
Can you look at this and fix it in any future version, please.
Best regards,
Krzysztof
TZQuery and line comments
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: TZQuery and line comments
Hi,
could you attach a example, please?
could you attach a example, please?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: TZQuery and line comments
Hello Michael,
I had similar issues with one of my programs. It is like this:
Zeos will accept the comments of style /* */ but not the ones introduced by dashes (--). Also it will pass these comments on to the DBMS but remove the line breaks before doing so. At least for Firebird. That in turn will make the RDBMS very unhappy...
Best regards,
Jan
I had similar issues with one of my programs. It is like this:
Code: Select all
/* This comment is no problem */
insert into testtable (Nr, Name) values (1, 'Test'); -- this comment will give a problem. It is introduced by two dashes and extends until the end of the line
insert into testtable (Nr, Name) values (2, 'Test'); /* whereas this kind of commenting works without problems */
-- this comment will also give a problem
Best regards,
Jan
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: TZQuery and line comments
Jan,
did test your example with current 7.2 (SVN)
All issues i could see are the multiple stmts to execute.
Am i doing something wrong here?
did test your example with current 7.2 (SVN)
All issues i could see are the multiple stmts to execute.
Code: Select all
procedure ZTestCompCoreBugReport.TestLineComments;
var
Query: TZQuery;
Executed: Boolean;
begin
if SkipForReason(srClosedBug) then Exit;
Query := CreateQuery;
try
Query.SQL.Add('/* This comment is no problem */');
Query.SQL.Add('insert into string_values (s_id, s_varchar) values (100000, ''TestLineComment''); -- whereas this kind of commenting works without problems');
Query.SQL.Add('-- this comment will also give a problem');
Query.ExecSQL;
Executed := True;
finally
Query.SQL.Text := 'delete from string_values where s_id = 100000';
Query.ExecSQL;
Query.Free;
end;
Check(Executed, 'Executed with line comments successfully');
end;
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Re: TZQuery and line comments
@Michael,
For example for Firebird
these two lines:causes an error.
Michal
For example for Firebird
these two lines:
Code: Select all
-- Comment
select * from table
Michal
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: TZQuery and line comments
Should work now.
Patch done R3348 \testing-7.2 (SVN)
Patch done R3348 \testing-7.2 (SVN)
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Re: TZQuery and line comments
@EgonHugeist ,
Bravo, you fixed!
Michal
Bravo, you fixed!
Michal