[Mydatabasepilot-cvs] MyDatabasePilot/Query recordCount.cfm,NONE,1.1
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-05-08 02:51:27
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/Query In directory sc8-pr-cvs1:/tmp/cvs-serv13675 Added Files: recordCount.cfm Log Message: Functionality Added: [ 734419 ] Create a recordCount query --- NEW FILE: recordCount.cfm --- <!---******************************************************************************************* * Copyright: MyDatabase Pilot is distributed under the terms of the GNU GPL license * * Template: Query/recordCount.cfm * * Purpose: Creates a Record Set with the number of records in the requested table * * Requiremets: - Connection Variables must already be set * * - Name of the table for which record count is needed must be passed * ********************************************************************************************---> <!---||| Find out the number of records in the current table |||---> <!--- Initiate a Read Only lock to ensure the integrity of session variables ---> <cflock timeout=20 throwontimeout="no" type="readonly" scope="session"> <!--- Create Recordset with a row count ---> <cfquery name="recordCount" datasource="#session.dataSource#" username="#session.userName#" password="#session.password#"> <!--- Use numOrRows as the alias for the column, ---> <!--- because ColdFusion does not allow special chars like * in variables ---> SELECT COUNT(*) AS numOfRows FROM #table#; </cfquery> </cflock> |