Le Thursday 16 October 2008 22:08:22 Kari Laine, vous avez écrit :
> Hi,
>
> i cannot figure out how the get inserted autoincrement column right after
> addition to table.
>
> I have
> ------------------------
>   rResult3 = $hConn.Create("files")
>
>   rResult3!filename = sFile
>   rResult3!md5sum = MUtils.md5sum(sDir, sFile)
>   rResult3!lastaccess = Stat(sdir &/ sFile, TRUE).LastAccess
>   rResult3!lastchange = Stat(sdir &/ sFile, TRUE).LastChange
>   rResult3!lastmodified = Stat(sdir &/ sFile, TRUE).LastModified
>   rResult3!size = Stat(sdir &/ sFile, TRUE).Size
>
> rResult3.Update
> ----------------------
>
> after this I would have to add record to related table which among others
> need the autoincrement column of the first insert..
>
>
> Hopefully someone understands what I am trying to ask here...

Perhaps, i don't know :)

If your key name is "lind" or other name if you want

db AS NEW Connection
Tab = "files"
TRY db.Exec("ALTER TABLE " & Tab & " DROP PRIMARY KEY ")
TRY db.Exec("ALTER TABLE " & Tab & " ADD (lind INT unique)")
TRY db.Exec("ALTER TABLE " & Tab & " change lind lind INT unique NOT NULL 
AUTO_INCREMENT")

is it it that you wanted to know?

Jacky 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to