Ben, 

It is definitely not ANSI SQL. ANSI SQL says "All operations are 
defined by logic, not by the position of a row within a table.... The rows 
of a relational database table are in arbitrary order -- the order in which 
they appear will not necessarily reflect the order in which they were 
entered or that in which they are stored on disk."  

It also won't work for you if two users added rows at about the same 
time and then both use the COUNT=LAST logic, since the first insert 
could get the second row inserted. In R:Base, COUNT = INSERT might 
help there, but in an Tango/Oterro application, the user is always the 
same user (Oterro), so you have the same problem as with LAST.

In SQL Server, perhaps you can do a query selecting the max 
(idcolumn) WHERE every column into which you inserted non null 
values = the values you inserted.  (In fact, that's a little safer in R:Base.  
If you time stamp and user stamp your rows, you may not even need to 
use ALL the columns.)



On Wed, 22 Aug 2001 21:23:30 +0200, Ben Weeda wrote:

>In R:Base and Oterro you can use WHERE COUNT = LAST to select 
the last record that you added. For instance to read the ID-column that 
R:Base assigned to a record if the ID is AUTONUMBER. 
>Is this standard ANSI SQL, or is it a plus that R:Base gives you? I 
couldn't get it to work in a SQL-server 2000 database.







Reply via email to