V4MD cursor xtra "Wrong number of parameters" error
Andrew Sinning
andrew at learningware.com
Thu Aug 21 09:10:08 CDT 2003
According to the documentation, creating a new cursor instance ("xtra")
has 3 optional parameters {location, lockType and direction}; however,
any attempt to specify more than the first 3 required parameters {new
object me, integer VDataBaseRef, string SQLquery}results in an error
"Wrong number of parameters".
How do I specify a non-default parameter location, lockType or
direction? Perhaps this is a restriction of the demonstration
(unregistered) version?
Thanks.
-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net]On Behalf Of Ruslan
Zasukhin
Sent: Wednesday, August 20, 2003 5:18 PM
To: valentina at lists.macserve.net
Subject: Re: getting Index after INSERT INTO
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
-------------------------------------------------------------
_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list