You are not logged in.
Pages: 1
Hi
I have my own TSQLAuthUser record called TECSQLAuthUser) and when I attempt to create such a record to my database I get the following error:
Cannot insert the value NULL into column 'Data', table ECSSQLAuthUsers; column not allow null, INSERT fails
This is a reasonable sql error as mORMot has created the table with the column Data declared as NOT NULL'
My database is an MSSQL database and I am using the ZEOS components/classes.
In my code I do not assign a value to my TECSQLAuthUser Data field but I still get the error when I do assign a value.
Would you please assist with my problem.
Regards
Graeme
Offline
Hi Arnold
Thanks for the quick reply.
The tables (ECAuthGroups and ECAuthUsers) were created by mORMot code.
The SQL to create the table looks like
CREATE TABLE [dbo].[ECSQLAuthUsers](
[ID] [bigint] NOT NULL,
[LogonName] [nvarchar](20) NOT NULL,
[DisplayName] [nvarchar](50) NOT NULL,
[PasswordHashHexa] [nvarchar](64) NOT NULL,
[GroupRights] [bigint] NOT NULL,
[Data] [varbinary](max) NOT NULL,
[Initials] [nvarchar](10) NOT NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC ...........
The tables ere create during the call to CreateMissingTables and I also found the the tables would be created on the first call to CreateAndFillPrepare if the
CreateMissingTables method was not called.
Regards
Graeme
Offline
Hi Arnold
I forgot to mention that I manually changed the definition to NOT NULL and a problem occurred further into the execution that seemed to imply mORMOT could not handle a NUL value for the field Data.
Regards
Graeme
Offline
mORMot shouldn't create the fields with NOT NULL.
I am not able to reproduce it here.
BTW: this is not the correct thread for such questions.
You should have posted this in https://synopse.info/forum/viewforum.php?id=2
Online
Pages: 1