RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAdoDbxCommand.ExecuteScalar Method

Execute a SQL query and return the first column of the first row of data.

Pascal
function ExecuteScalar: System; override;
C++
virtual __fastcall System ExecuteScalar();

ExecuteScalar returns only the first column of the first row of data from a SQL query.

Note: ExecuteScalar is useful for running aggregate SQL commands, such as select sum(field) from table.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!