Bob,
When you insert your row there must be a unique combination of values to identify the row, other than the table’s key. If these are ‘a’, ‘b’ and ‘c’: INSERT INTO servertable (a,b,c) VALUES (.va,.vb,.vc) SELECT keycolumn INTO vkey FROM servertable WHERE a = .va and b = .vb and c = .vc This should retrieve the key value from the row just inserted. If not, there’s something wrong with your ODBC or your server table. Emmitt Dove Manager, Converting Applications Development Evergreen Packaging, Inc. [email protected] (203) 214-5683 m (203) 643-8022 o (203) 643-8086 f [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Monday, May 10, 2010 11:52 To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Confirm Where count = INSERT Thanks Bill and Dennis, The COUNT = LAST gives an error - -ERROR- Cannot use LAST with a server table. (2621) I would run into problems with this anyway since this is in a fairly heavy multi-user environment. I issued the Select statement immediately after the INSERT and still did not get the correct returned value, so I do not think the connection was closed. I imagine the syntax is not supported on an ODBC table like the above "LAST" clause, but it just does not return an error. I will use the MAX statement. I was hoping to use the COUNT = INSERT as it is almost instantaneous and using the MAX and a where statement will be slower on this large table. I imagine the speed will be acceptable though. Thanks, -Bob ----- Original Message ----- From: "Bill Downall" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Monday, May 10, 2010 10:07:26 AM GMT -06:00 US/Canada Central Subject: [RBASE-L] - Re: Confirm Where count = INSERT Bob, It's possible that your ODBC connection was closed after the previous command, so that Oterro cannot really find the last row inserted by this particular connection. Try COUNT = LAST (if another user's simultaneous hit of the same code is highly unlikely), or build a where clause that will find the row you want with no ambiguity. Bill On Mon, May 10, 2010 at 8:51 AM, <[email protected]> wrote: I have two RBASE databases -- Database "A" and "B". I have one table in "B" that I need occasional access to from "A". I have setup an ODBC connection between the two. However, I need to use a command that I am not sure is supported with the ODBC connection. "where count = insert:" The command does return a value and does not give any error, but the value returned is not the inserted value. SkidData is the RBASE ODBC table and has an autonum column "LabelNo". R>insert into skiddata (PrimaryMO,ITEM,RecNotes ) values 'test','test','Testing ODBC' Successful INSERT operation, 1 rows generated. R>sel labelno from skiddata where count = insert labelno ---------- 363 The actual value inserted above was 412. The returned value of 363 from the "count = insert" statement is from the first row in the table. I would like to confirm that the "count = insert" function is not supported on ODBC tables and any ideas on how I might obtain the same functionality if it is not supported. Thanks, -Bob

