Hello,
I just discovered a behaviour I do not understand - and maybe it's a bug???
Having the following code in a XData Service function
function someservice.personwith4fields: TStream;
var
lStatement: IDBStatement;
lResultSet: IDBResultSet;
lSQL: string;
i: integer;
begin
lStatement := TXDataOperationContext.Current.GetManager.Connection.CreateStatement;
lSQL := 'SELECT p.id, p.user, p.name, p.vorname FROM profil p WHERE p.id = 9';
lStatement.SetSQLCommand(lSQL);
lResultSet := lStatement.ExecuteQuery;
while lResultSet.Next do
begin
for i := 0 to 3 do
CodeSite.SendVariant(i.ToString, lResultSet.GetFieldValue(i));
end;
// I do only get values for i := 1 to 3 - no exception with 0 - nothing in CodeSite
// but with this line I get the value of index 0
CodeSite.Send('index[0]', VarToStr(lResultSet.GetFieldValue(0)));
Result := // process the GetFieldValues and build a response as JSON
TXDataOperationContext.Current.Response.Headers.SetValue('content-type', 'application/json');
end;
The data I have in table "profil" looks as follows:
[Entity]
[Table('profil')]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TaProfil = class
private
[Column('id', [TColumnProp.Required, TColumnProp.NoInsert, TColumnProp.NoUpdate])]
FId: Int64;
[Column('vorname', [], 50)]
FVorname: Nullable<string>;
[Column('name', [], 50)]
FName: Nullable<string>;
[Column('user', [], 100)]
FUser: Nullable<string>;
public
property Id: Int64 read FId write FId;
property Vorname: Nullable<string> read FVorname write FVorname;
property Name: Nullable<string> read FName write FName;
property User: Nullable<string> read FUser write FUser;
end;
In CodeSite I get the only the following 4 lines:
1 = some username
2 = some lastname
3 = some firstname
index[0] = 9
Why do I not get this: ???
0 = 9
1 = some username
2 = some lastname
3 = some firstname
index[0] = 9
Regards
Harald
An issue with CodeSite, maybe? I see no reason why you wouldn't get the value, from the code presented.
Hello Wagner,
thanks for Your answer. And: You are right. Sorry for bothering You with this issue. It is a codesite problem. It seems that codesite cannot log any Int64-Values. I'll post this to the Codesite forum.
Regards
Harald