Jump to content
Sign in to follow this  
nguyenbason

how to query a sql with autoit (mssql)

Recommended Posts

nguyenbason

Hello all,

Before posting this topic, I searched forum and google. I found some topic about this thing, like: http://www.autoitscript.com/forum/index.php?showtopic=51952

But all post are showing me the return of array:

eg: $iRval = _SQL_QuerySingleRow(-1,"SELECT * FROM member;",$aRow)

i just want to get value of a exactly comlumn. Example:

Select name from customer where phone=123456

or

Delete from items where name='abc' and phone='123456'

....

Have you any for this?

Thanks in advance,


UnderWorldVN- Just play the way you like it

Share this post


Link to post
Share on other sites
ChrisL

If your using my UDF that you linked to above, then just use

Local $aRow
_SQL_QuerySingleRow(-1,"Select name from customer where phone='123456'",$aRow)
If $iRval = $SQL_OK then Msgbox(0,"",$aRow[0])

The single value returned will be in $aRow[0]

For your other one use

_SQL_Execute(-1,"Delete from items where name='abc' and phone='123456'")

Edited by ChrisL

Share this post


Link to post
Share on other sites
nguyenbason

If your using my UDF that you linked to above, then just use

Local $aRow
_SQL_QuerySingleRow(-1,"Select name from customer where phone='123456'",$aRow)
If $iRval = $SQL_OK then Msgbox(0,"",$aRow[0])

The single value returned will be in $aRow[0]

For your other one use

_SQL_Execute(-1,"Delete from items where name='abc' and phone='123456'")

Very usefull. Working perfectly. Thanks much ChrisL!!!

UnderWorldVN- Just play the way you like it

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×