Jump to content
Sign in to follow this  

_sql.au3 help

Recommended Posts

I am trying to get _ArrayToString to work or find way to get the variable(name of company) out of array ($aData).

<autoit>Local $aData,$iRows,$iColumns;Variables to store the array data in to and the row count and the column count

$iRval = _SQL_GetTable2D(-1,"SELECT Address FROM CUSTOMER WHERE CompanyName = '"&$compname&"';",$aData,$iRows,$iColumns)

If $iRval = $SQL_OK then _arrayDisplay($aData,"2D (" & $iRows & " Rows) (" & $iColumns & " Columns)" )

Local $str

If Not IsArray($aData) Then SetError(1)

If @error = 1 Then

MsgBox(0,"@error","NOT ARRAY")


$str = _ArrayToString($aData,"",0,0)

MsgBox(0, "$str", $str)</autoit>

This returns blank.

Share this post

Link to post
Share on other sites

With your SELECT, you can only expect to grab the address not hte name, but you know thename already, don't you?

Now look again at _ArrayToString in help file, and more precisely at @error return values (specially when it is 3). OK ? This function only works for 1D arrays.

Why use this function anyway, you don't need it. The data you're after is probably in $aData[1][0] if the first row contains the column names. You just displayed the array contents, where the data is should be clear!

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...