stinson6016 Posted July 7, 2009 Share Posted July 7, 2009 I'm trying to switch a script from sqlite to sql at work to work on our network but I can find any way to get the last inserted row like "_SQLite_LastInsertRowID" everything that I try that I find in a search online says to use @@identity or scope_identity() but they return nothing at all. they say to just do a "select scope_identity()" and you'll get the last inserted row, but I just get an empty value. this is an small example of what I'm working with. CODE#include "Mask\MaskMSSQL.au3" Global $db ; databases $db = SQL_Startup(@ComputerName & "\SQLEXPRESS", "cc") ; mssql $value = _SQL_Execute($db, "insert into holders (name) values ('test1');") $value = _SQL_Execute($db, "SELECT @ID") MsgBox(0, "", $value) Func OnAutoItExit() SQL_Exit() EndFunc ;==>OnAutoItExit Gnatwork Networks Link to comment Share on other sites More sharing options...
weaponx Posted July 7, 2009 Share Posted July 7, 2009 What SQL UDF are you using? This one? If so you aren't using it correctly. It clearly says in the source code that _SQL_Execute returns a handle to a query. You need to call _SQL_FetchData after or _SQL_QuerySingleRow instead of _SQL_Execute.Follow the example that is provided. Link to comment Share on other sites More sharing options...
stinson6016 Posted July 7, 2009 Author Share Posted July 7, 2009 Well now that makes a lot of sence. I guess I didn't fully read everything. Thanks a lot Gnatwork Networks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now