GSAK (Geocaching Swiss Army Knife)
 

Contents - Index


SqlGet (function)

SqlGet(sField) : string

Optimized function to retrieve information from a SQLite query. Best used to iterate through a SQLite table.

This function should be used in conjunction with the SqlGet=Yes option of Sqlite(). It will allow you to retrieve the value of any field in the current SQLite query. Note: The return value of this function is *always* a string, and the full fidelity of the orginal string contents is preserved. You will need to convert date, numeric, and boolean values to their native format if you want to use functions that require the data in these formats. However, this is no different to the existing behaviour of the "Sql" action without SqlGet=Yes, as it too only ever returns string values.

See also Sqlite(), SqlGetClose(), SqlNext

The following two code snippets are equivalent. However example 1 is much more efficient and will run about 6x faster.
 
Example 1
 

$status = sqlite("sql",$_SqlGrid, "sqlget=yes")
while not($_sqleol)
  $data = sqlget("code") + sqlget("name") + sqlget("userdata")
  sqlnext
Endwhile

 
Example 2
 

GoTo Position=Top
While not($_Eol)
  $data = $d_code + $d_name + $d_userdata
  GoTo position=Next
EndWhile
GoTo postion=Top


Alpha List         Category List

Copyright 2004-2011 CWE Computer Services  
Privacy Policy Contact