Query (datatype String): SQL select statement to
retrieve the data Query (datatype Range): Range of cells
containing the SQL select statement to
retrieve the data
Transpose (datatype Boolean): Optional; display rows as columns.
Rownum (datatype Number): Optional;
row number of the result row to display
Description:
The
SQLQueryValue function runs a query in the database and displays the result in
the cell. In the Query parameter the SQL statement should be given. If you
retrieve multiple columns (e.g. select col1, col2, col3 from mytable) then
SQL*XL will only display the value of the first column. It is therefore not
useful to list more than one column in your query. It is also
not
useful to retrieve more than one row. By default
SQLQueryValue will display row 1 unless you specify a different rownumber
in the Rownum variable
SQLXLQueryValueVolatile does exactly the same but this function will always be
evaluated when Excel calculates.
Examples: A1: =SQLQueryValue( "select ename from emp where empno
= 123" ) A2:
=SQLQueryValue( concatenate( "select ename from emp where empno = " ,
D12 ) ) A3: =SQLQueryValue( concatenate( "select sal from emp where
ename ='", E25 , "'") ) --Note that the function is A3 wraps the
string retrieved from E25 in single quotes.
A1: =SQLQueryValue( concatenate( "select
count(*) from ", , D10 ) --Note that this is dynamic sql where the value in the
cell represents the number of rows in the table name found in D10
Copyright (C) 1995-2007 Linker IT
Software BV. All Rights Reserved. Oracle is a registered trademark of
Oracle corporation. Excel and Office are registered trademarks of
Microsoft corporation. Other names appearing on the site may be trademarks
of their respective owners. Software,
files, documents, articles and other material are provided
"as is" and without warranties as to performance or mechantability or
any other warranties whether expressed or implied. No
warranty of fitness for a particular purpose is offered.
sitemap