I’ve recently checked my custom Delphi server & I’ve noticed that datWideMemo fields have inexplicably changed to datWideString (size 32767).
I know I didn’t make this change because I am very careful to avoid doing any refresh fields on this datatable as there’s 900+ fields with a load of custom attributes that I don’t relish spending days re-creating.
How can I prevent this happening again?
Also, how can I change them all back again easily – with respect, the DASM8 is not designed for bulk updates (which is something you should address really - field by field updates for large datatables are painful to say the least)
Could you send a mail to support@ with your schema and connection files (in the last one remove the db password and username, we need to know only the exact DB driver you’re using). Also could you please say exact version of Data Abstract you are using?
it can be a reason why it was detected as datWideString(32767).
we use such code for detecting datatypes of SQLite:
else if (lType = 'nvarchar') or (lType = 'nvarchar2') or (lType = 'national') and (
(lMod = 'char varying') or (lMod = 'character varying') or
(lMod = 'varying char') or (lMod = 'varying character')) or
(lType = 'string') then begin
Fields[i].Size := StrToIntDef(lArgs, 255);
Fields[i].DataType := datWideString;
end
..
else if (lType = 'ntext') or (lType = 'wtext') or (lType = 'nclob') or (lType = 'nmemo') or
(lType = 'long') and ((lMod = 'ntext') or (lMod = 'wtext')) or
(lType = 'national') and (lMod = 'text') or
(lType = 'longwchar') or (lType = 'longwvarchar') or
(lType = 'html') then begin
Fields[i].Size := StrToIntDef(lArgs, 0);
Fields[i].DataType := datWideMemo;
end
When I said NVarChar(max) – I was referring to the MSSQL statement.
You’re right though, in SQLite database, the columns are defined as NVARCHAR - with no size qualifier. E.g.
"ADMISSIONCOMMENTS" NVARCHAR COLLATE NOCASE,
This would’ve been caused by the conversion tool I used, I guess.
It does however work equally as a text field… perhaps if you encounter an NVARCHAR field with no Size parameter in SQLite you should make it a datWideMemo field…? Seems logical to me
Yes, the official data types of SQLite are limited, granted, but I’ve always used NVarChar(size) to specify variable length fields (even though they don’t really have a length in SQlite) & it’s worked well, and RO/DA has handled it well.
However, it doesn’t seem to make much sense to convert NVarChar(unspecified) to datWideString(32767), when the same conversion for SQL Server produces datWideMemo
It basically means that switching from SQLite to SQL Server breaks the client - you get the error “Format of the data in the stream doesn’t match the destination table format” for what is effectively the same field & data structure.
This is surely contrary to one of the basic philosophies of RemObject DataAbstract in that you write the client once and the SQL differences are handled on the server?
Perhaps there’s a way of allowing a developer to map these unknown types to the TDADataType. I would gladly maintain such a list (perhaps in DASM) that says SQLite:NVarChar(unspecified) = datWideMemo
as a temporary workaround, you can change uDASQLiteInterfaces.pas, recompile used driver with any unicode version of Delphi and put it near DASchemaModeler7.exe