-- SQL Error: Dynamic SQL Error SQL error code = -206 Column unknown I1HyzRwgIcLIoozFpmslqloFuE23G5vABtQnow7nFDgK8PdmcQ/igLB At line 1, column 173. Error Code: -206. Column does not belong to referenced table
The SQL: INSERT INTO MENU (CODIGOMENU, DESCRIPCION, ..) VALUES ( 389, "I1HyzRwgIcLIoozFpmslqloFuE23G5vABtQnow7nFDgK8PdmcQ/igLB" )
It seems that strings containing the / character, confuses the parser. The string is returned without the '"'.
Any Ideas?
Regards
Delphi 2010 with Firebird 2.1: new bug in TZSqlProcessor
Moderators: gto, EgonHugeist, olehs
-
- Fresh Boarder
- Posts: 4
- Joined: 20.10.2011, 14:04
-
- Fresh Boarder
- Posts: 4
- Joined: 20.10.2011, 14:04
Solution
The problem was solved setting the db dialect on 1. I was using dialect 3 on a DB dialect 1. This must be done on TZConnection, "properties".
Dialect=1
The error WAS NOT in the parser, although, i used this modified section on the ZGenericSqlToken unit.
Dialect=1
The error WAS NOT in the parser, although, i used this modified section on the ZGenericSqlToken unit.
Code: Select all
function TZGenericSQLQuoteState.NextToken(Stream: TStream;
FirstChar: Char; Tokenizer: TZTokenizer): TZToken;
var
ReadChar: Char;
ReadCharAnt : Char;
LastChar: Char;
CountFormat, CountDoublePoint,CountSlash : integer;
begin
Result.Value := FirstChar;
LastChar := #0;
CountDoublePoint := 0;
CountSlash := 0; CountFormat := 0;
ReadCharAnt := #0;
while Stream.Read(ReadChar, SizeOf(Char)) > 0 do
begin
if (LastChar = FirstChar) and (ReadChar <> FirstChar) then
begin
Stream.Seek(-SizeOf(Char), soFromCurrent);
Break;
end;
if ReadChar = TimeSeparator then
inc(CountDoublePoint);
if ReadChar = DateSeparator then
inc(CountSlash);
if (ReadCharAnt = '%') and (Pos( AnsiLowerCase(ReadChar), '/:0124356789abcdefhijklprstuvwxy') > 0) then
inc(CountFormat);
Result.Value := Result.Value + ReadChar;
if (LastChar = FirstChar) and (ReadChar = FirstChar) then
LastChar := #0
else LastChar := ReadChar;
ReadCharAnt := ReadChar;
end;
if (FirstChar = '"' ) or (FirstChar = #39) then
Result.TokenType := ttWord
else
Result.TokenType := ttQuoted;
// Time constant
if (CountFormat <> 0) and (CountDoublePoint = 2) and (CountSlash = 0) then
begin
try
Result.Value := DecodeString(Result.Value,'"');
Result.TokenType := ttTime;
except
end;
end;
// Date constant
if (CountFormat <> 0) and (CountDoublePoint = 0) and (CountSlash = 2) then
begin
try
Result.Value := DecodeString(Result.Value,'"');
Result.TokenType := ttDate;
except
end;
end;
// DateTime constant
if (CountFormat <> 0) and (CountDoublePoint = 2) and (CountSlash = 2) then
begin
try
Result.Value := DecodeString(Result.Value,'"');
Result.TokenType := ttDateTime;
except
end;
end;
end;
-
- Expert Boarder
- Posts: 113
- Joined: 06.10.2006, 14:41
- Location: Chapecó - Santa Catarina
- Contact: