Page 20 of 44

Posted: 26.07.2012, 16:10
by miab3
@EgonHugeist

Zeos7testing_1598 compiles and runs on D2006, DXE2 32/64, LazarusWin1.1.0/fpc 2.7.1 32/64. (With a small exception on Oracle AQ$_QUEUES).

Could you ask for, how to use the new functionality of master-detail in a few words?

@ludob

I use {$Z+}, but this error occurs for DXE2-32(For DXE2-64 error does not occur). Michael mentioned that in his some versions of Delphi, too.

Michal

Posted: 26.07.2012, 18:23
by EgonHugeist
@miab3,

Code: Select all

  MasterQuery.SQL.Text := 'SELECT * FROM department ORDER BY dep_id';
  MasterQuery.Open;

  DetailQuery.SQL.Text := 'SELECT * FROM people';
  DetailQuery.MasterSource := MasterDataSource;
  DetailQuery.MasterFields := 'dep_id';
  DetailQuery.LinkedFields := 'p_dep_id';
  DetailQuery.Open;

  MasterQuery.First;
  CheckEquals(1, MasterQuery.FieldByName('dep_id').AsInteger);
  CheckEquals(2, DetailQuery.RecordCount);
  CheckEquals(1, DetailQuery.FieldByName('p_dep_id').AsInteger);

  MasterQuery.Next;
  CheckEquals(2, MasterQuery.FieldByName('dep_id').AsInteger);
  CheckEquals(2, DetailQuery.RecordCount);
  CheckEquals(2, DetailQuery.FieldByName('p_dep_id').AsInteger);
this is a master-datail relation. You can find examples also in unit \test\ZTestMasterDetail.pas

I think this example is better than my broken english. :)

Michael

Posted: 26.07.2012, 20:37
by olehs
EgonHugeist,

In PostgreSQLToSQLType(oid and typename version) bpchar(oid=1042) should be treated as char

Posted: 27.07.2012, 07:44
by EgonHugeist
olehs,

1042: Result := stString; { bpchar }
Is defined as stringvalue. Is this type also dependend to the clientencoding? If yes i've to use:

if Connection.GetClientCodePageInformations^.Encoding = ceUTF8 then
if Connection.UTF8StringAsWideField then
Result := stUnicodeString
else
Result := stString
else
Result := stString;


i applyed your patch of with the GetServerSetting/SetServerSetting. I like that idea, good work.

Michael

Btw. did you setup our testsuites? If yes and you know how to run the tests: Don't forget to ask for commit privileges.

Posted: 27.07.2012, 08:47
by EgonHugeist
olehs,

this type is hadled as stString. Is this type also clientencoding dependent?

Michael

Posted: 27.07.2012, 10:08
by olehs
EgonHugeist,

Yes, it's clientencoding dependent.
did you setup our testsuites?
I'll do it tonight.

Posted: 27.07.2012, 16:03
by EgonHugeist
olehs,
I'll do it tonight.
sounds great for me. It is also very helpfull if you add some test to validate the result..

according the "bpchar": Patch done Rev.1611

Also do i wonder about "Bit" and "varbit". Are they right interpreted?

Michael

Posted: 28.07.2012, 10:05
by olehs
Also do i wonder about "Bit" and "varbit". Are they right interpreted?
Yes, they are just strings of 1's and 0's

Posted: 29.07.2012, 09:59
by EgonHugeist
olehs,

ok this is great. For me personally should be a bit 0 or 1=stByte. But if this is ok for postgre..

Michael

Posted: 29.07.2012, 11:41
by miab3
@EgonHugeist
@ludob

Zeos7testing_1621 compiles and runs on D2006, DXE2 32/64, LazarusWin1.1.0/fpc 2.7.1 32/64. (With a small exception on Oracle AQ$_QUEUES in DXE2-32).

Since the error with Oracle AQ$_QUEUES is quite by accident that I think the reason that it is a garbage of memory. I've met in Delphi errors resulting from not cleaned the data memory areas before using.

Michal

Posted: 30.07.2012, 08:36
by miab3
@EgonHugeist

Too many declarations:
SetEscapeMarkSequence procedure (const Value: String);
in ZTokenizer.pas (r1623)
(Line 459 and 485)
Something is wrong with svn.

Michal

Posted: 30.07.2012, 08:50
by EgonHugeist
@miab3,

Too many declarations:
SetEscapeMarkSequence procedure (const Value: String);
in ZTokenizer.pas (r1623)
(Line 459 and 485)
Something is wrong with svn.

Michal, what does that mean? I can compile everything without problems. What happens?

Michael

Posted: 30.07.2012, 09:10
by miab3
@EgonHugeist

Delphi 2006 does not want to compile two declarations:

IZTokenizer = interface (IZInterface)
['{C7CF190B-C45B-4AB4-A406-5999643DF6A0}']
...
function GetCharacterState(StartChar: Char): TZTokenizerState;
procedure SetEscapeMarkSequence(const Value: String); <-------------------------
function AnsiGetEscapeString(const Ansi: ZAnsiString;
const EscapeMarkSequence: String = '~<|'): String;
function GetEscapeString(const Str: String;
const EscapeMarkSequence: String = '~<|'): String;
function TokenizeEscapeBufferToList(const SQL: String;
const EscapeMarkSequence: String = '~<|'): TZTokenDynArray;
end;

{** Implements a default tokenizer object. }
TZTokenizer = class (TZAbstractObject, IZTokenizer)
private
{$IFDEF DELPHI12_UP}
FCharacterStates: array[0..ord(high(char))] of TZTokenizerState;
{$ELSE}
FCharacterStates: array[0..255] of TZTokenizerState;
{$ENDIF}
FCommentState: TZCommentState;
FNumberState: TZNumberState;
FQuoteState: TZQuoteState;
FSymbolState: TZSymbolState;
FWhitespaceState: TZWhitespaceState;
FWordState: TZWordState;
FEscapeState: TZEscapeState; //EgonHugeist
FMarkSequence: String;
function GetEscapeMarkSequence: String;
procedure SetEscapeMarkSequence(const Value: String); <-------------------------
protected

Michal

Posted: 30.07.2012, 09:19
by EgonHugeist
miab3,

???? What's that? Can you change the ordor of the packages? Compile ZPlain before ZParseSQL. Does this help?

Michael

Posted: 30.07.2012, 09:27
by miab3
@EgonHugeist

So for me it is and Causes Error:

[Pascal Error] ZPostgreSqlToken.pas(114): E2003 Undeclared identifier: 'SetEscapeMarkSequence'
[Pascal Fatal Error] ZInterbaseToken.pas(61): F2063 Could not compile used unit '..\..\src\parsesql\ZPostgreSqlToken.pas'

(From Delphi2007 Delphi use MSBuild as the build engine)

Michal