Jump to content

how to query a sql with autoit (mssql)


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...