DIM result as P = SQL_lookup_multi(C conn, C table, C filter, C fieldlist [, SQL::Arguments Args [, L portableSQL]])
DIM result as P = SQL_lookup_multi(SQL::Connection conn, C table, C filter, C fieldlist [, SQL::Arguments Args [, L portableSQL]])
An open SQL::Connection object, named SQL connection string, or ad-hoc SQL connection string.
Using an open SQL::Connection will improve the performance of the lookup.
The name of the SQL table to query.
Used to uniquely identify the record to lookup. The filter can use arguments (e.g. city = :what_city and state = :what_state)
A comma delimited list of fields to return.
A SQL::Arguments object that defines the arguments used in the filter. Required if the filter uses SQL arguments.
Default = .f.. Indicates whether or not the query should be executed using Portable SQL.
Returns an Xbasic object with properties for each field returned by the query. If multiple records match the filter, only data from the first record is returned. If no records match, returns an empty object.
If an error occurs (e.g. the specified table doesn't exist), returns an object with the following properties:
A description of the error that occurred, if any.
If .t., an error occurred. Check the value of errorText for information about the error.
Does a lookup into a SQL table to retrieve multiple values from a record.
dim result as p dim cs as c = "::Name::AADemo-Northwind" result = sql_lookup_multi(cs,"customers","customerid = 'ALFKI'","city,country,contactname") ? result = city = "Berlin" contactname = "Maria Anders" country = "Germany" ' Using Arguments: dim args as SQL::Arguments args.set("what_country","USA") result = sql_lookup_multi(cs,"customers","country = :what_country","city,country,contactname",args) ? result = city = "Eugene" contactname = "Howard Snyder" country = "USA"