getting Index after INSERT INTO

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Aug 21 01:17:51 CDT 2003


on 8/21/03 12:27 AM, Andrew Sinning at andrew at learningware.com wrote:

> Well, first of all, how do I create an "AUTO_INCREMENT" field?

No such feature in 1.x
 
RecID can often be used instead.

> How about:
> 
> fieldId UMedium NOT NULL UNIQUE INDEXED
> 
> ?

What you ask about here?


> Now, assuming I've got an auto incrementing index, how do I get the
> index after an INSERT INTO?  Something like MySQL's "LAST_INSERT_ID()"
> or PHP's "mysql_insert_id()".
> 
> BTW: I'm using Valentina for Macromedia Director (V4MD).

After INSERT INTO there is no way to get this.
We need also add something as LAST_INSERT_ID

But if you will use Vcursor and built it as

    SELECT RecID, other fields
    FROM T 
    WHERE RecID = 0

Then you do 
    
    cursor.SetBlank()

    cursor.field("a") = 5
    ...    

    cursor.AddRecord()


Now RecID field contains RecID of just added record.
So you can get it using

    cursor.GetValue( "RecID" )



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list