Oracle.pas Problem

llz

Member
I find a snap problem in function
RemoveSQLComment(const ASQL: string):String;

if (c1 = '-') and (c2 = '-') then Mode := '-';
if the '--' is in constant string , It will
delete after words include '''' and produce
an error :ORA-01756 .

I add some codes after
"if (c1 = '-') and (c2 = '-') then Mode := '-';"
to resolve this problem:
if (c1 = '''') then
begin
Result :=Result +'''';
j :=i +1;
while c2 '''' do
begin
Result :=Result + c2;
c2 :=ASQL[j+1];
inc(j);
end;
Result :=Result + '''';
c1 :=ASQL[j+1];
c2 :=ASQL[j+2];
i :=j+1;
end;

Is there any better resolvent? Please tell me
 
This sounds like a bug that was fixed in 3.4.3. Are you using 3.4.2 or earlier?

------------------
Marco Kalter
Allround Automations
 
Back
Top