#1 2023-07-04 06:19:21

songshuang
Member
From: changzhou,jiangsu,china
Registered: 2018-08-09
Posts: 20

got a raise when using TSqlDBClientDataSet

sql :
  SELECT ''All'' as field1, count(*) as field2,' sum(case when ret=0 then 1 else 0 end) as field3
in this case , will got a raise :
        raise EVirtualDataSet.CreateUtf8('%.GetFieldData ColumnType=%', [self, TSqlDBFieldTypeToString(ColumnType)]);
   (in procedure :InternalInitFieldDefs, mormot.db.rad.ui.sql.pas )
I suggest add :
    ....
        mormot.db.core.ftNull, 
        mormot.db.core.ftUnknown:
          dbtype := ftWideString;
    ....

Offline

#2 2023-07-04 06:29:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: got a raise when using TSqlDBClientDataSet

With which DB backend?

Offline

#3 2023-07-04 06:36:44

songshuang
Member
From: changzhou,jiangsu,china
Registered: 2018-08-09
Posts: 20

Re: got a raise when using TSqlDBClientDataSet

aslite=TSQLModel.Create([
    TSQLAuthor...],'root');
arest=TSQLRestServerDB.create(aslite,filename);
TSqlDBClientDataSet.Connection=TSQLDBSQLite3ConnectionProperties.Create(arest.DB);

Offline

#4 2023-07-04 06:53:39

songshuang
Member
From: changzhou,jiangsu,china
Registered: 2018-08-09
Posts: 20

Re: got a raise when using TSqlDBClientDataSet

Above is my project: unigui+rest.
Besides, I hit a pit.  field:Text ,As records added,Sometimes it's a widestring, and later it's a widememo.
IgnoreColumnDataSize  of TSqlDBClientDataSet has no effect.becase using create(AOwner: TComponent)...
so,i changed default value of IgnoreColumnDataSize in mormot.db.rad.ui.sql.pas
...

Offline

#5 2023-07-04 07:12:08

songshuang
Member
From: changzhou,jiangsu,china
Registered: 2018-08-09
Posts: 20

Re: got a raise when using TSqlDBClientDataSet

geting a raise when query empty,but normal when not empty.

Offline

#6 2023-07-04 08:23:01

songshuang
Member
From: changzhou,jiangsu,china
Registered: 2018-08-09
Posts: 20

Re: got a raise when using TSqlDBClientDataSet

to assigned a datetype use cast ,Can be regarded as a good idea

Offline

Board footer

Powered by FluxBB