#1  
Old 11th February 2020, 03:01 AM
gsachs gsachs is offline
Member
 
Join Date: Oct 2008
Posts: 56
Default Memtable has autoinc value of NULL

I have an empty nxmemtable where I add one record :
MemTblPP.Append;
MemTblPP['Code'] := aCode;
MemTblPP['Name'] := aName;
MemTblPP.Post;
v := MemTblPP['ID'];

The ID field is declared as autoinc, after the post it should return an integer value, instead it returns NULL.
The ID field is used in an index, I already tried to set the providerflags to [pfInWhere, pfInKey].
Also I tried to set the AutoGenerateValue propetry of the Autoinc field to arDefault or arAutoinc, no success.
The memtable is connected to a separate database, which in turn is connected to the same session as the physical tables.

I often use this construct on physical tables (TnxTable) where I need the Autoinc value and had no problems so far.
What am I doing wrong ?
  #2  
Old 11th February 2020, 04:35 AM
Thorsten Engler [NDA]
 
Posts: n/a
Default Re: Memtable has autoinc value of NULL

Hi,

there is no difference between in-mem tables and physical tables except for
what the buffer manager does with the data blocks. As such, physical and
in-memory tables are going to behave exactly the same.

It's likely there is some error in how you've setup your mem-table, but I can't
tell what the problem is from just your description.

Please provide a minimal standalone testcase that demonstrates your problem.

Cheers,
Thorsten

gsachs wrote:

>
> I have an empty nxmemtable where I add one record :
> MemTblPP.Append;
> MemTblPP['Code'] := aCode;
> MemTblPP['Name'] := aName;
> MemTblPP.Post;
> v := MemTblPP['ID'];
>
> The ID field is declared as autoinc, after the post it should return an
> integer value, instead it returns NULL.
> The ID field is used in an index, I already tried to set the
> providerflags to [pfInWhere, pfInKey].
> Also I tried to set the AutoGenerateValue propetry of the Autoinc field
> to arDefault or arAutoinc, no success.
> The memtable is connected to a separate database, which in turn is
> connected to the same session as the physical tables.
>
> I often use this construct on physical tables (TnxTable) where I need
> the Autoinc value and had no problems so far.
> What am I doing wrong ?


  #3  
Old 11th February 2020, 11:07 AM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Memtable has autoinc value of NULL

> What am I doing wrong ?

Do you have a filter or range active, that makes the newly inserted
record invisible?

--
Eivind Bakkestuen [NDD]
  #4  
Old 11th February 2020, 07:12 PM
gsachs gsachs is offline
Member
 
Join Date: Oct 2008
Posts: 56
Default Solved

While preparing a demo project, I found that I used the wrong masterfield for a master-detail relation, so the new record was invisible as you suspected. It is working now, thank you.


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autoinc field + Memtable + Master/Detail + BatchAppend = zero :( =?ISO-8859-1?Q?Cl=E9mentDoss?= nexusdb.public.support 10 3rd June 2008 06:28 AM
Fastest move from memtable to memtable David Guest nexusdb.public.support 2 2nd June 2007 08:20 AM
SQL, MemTable, Table Robert Hultberg nexusdb.public.support.sql 5 29th January 2007 03:41 AM
Null values allowed in NOT NULL constraint Ole Willy Tuv nexusdb.public.support.sql 8 13th October 2005 02:33 PM
wish for Nexus Memtable S.Ben nexusdb.public.support 0 7th November 2003 07:04 PM


All times are GMT +11. The time now is 02:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.