You are not logged in.
Example:
SELECT Name||" / "||Code AS PartnerName FROM Partner.
Raise an error in (InternalInitFieldDefs) --> GetFieldData ColumnType = Unknown
Offline
This is my code:
FProps := TSQLDBSQLite3ConnectionProperties.Create(FSession.PathSession + '\cache.dat','','','');
TSynDBSQLDataSet(Properties.ListSource.DataSet).Connection := FProps;
TSynDBSQLDataSet(Properties.ListSource.DataSet).CommandText := 'SELECT ID, Level, Name||" / "||Code as PartnerName, Code FROM PARTNER WHERE Type=1';
Properties.ListSource.DataSet.Open; --> error raise after open
Offline
I'm sorry, here
Properties.ListSource := TDataSource.Create(Self);
Properties.ListSource.DataSet := TSynDBSQLDataSet.Create(Self);
FProps := TSQLDBSQLite3ConnectionProperties.Create(FSession.PathSession + '\cache.dat','','','');
TSynDBSQLDataSet(Properties.ListSource.DataSet).Connection := FProps;
TSynDBSQLDataSet(Properties.ListSource.DataSet).CommandText := 'SELECT ID, Level, Name||" / "||Code as PartnerName, Code FROM PARTNER WHERE Type=1';
Properties.ListSource.DataSet.Open; --> error raise after open
Is because SQLite is typeless ? so concatenation become unknown.
Using SQLiteStudio to identify my query, the result is unknown too for concatenation.
But when SELECT typeof( Name||" / "||Code) ... , the result is TEXT.
Sorry for my English
Offline
I'm not able to reproduce it here.
I'm able to run requests like this:
select id, Name||"/"||Attributes as toto from Event where clid=10
Please try just
SELECT Name||" / "||Code FROM PARTNER WHERE Type=1
Are both Name and Code TEXT non NULL fields?
Online
I'm not able to reproduce it here.
I'm able to run requests like this:select id, Name||"/"||Attributes as toto from Event where clid=10
Yes, it will able to run, what i mean is toto is known as ftUnknown in TSynBinaryDataSet.InternalInitFieldDefs. it should be ftUTF8 or something known.
Please try just
SELECT Name||" / "||Code FROM PARTNER WHERE Type=1
Are both Name and Code TEXT non NULL fields?
Yes, both are non NULL fields
Last edited by wienani (2017-04-24 06:39:33)
Offline