AJ Mercer in farcryland :) Don't know but watching with you...

On Apr 1, 7:22 am, AJ Mercer <[email protected]> wrote:
> What is this qCheck code all about in *fqaudit.cfc*?
>
> <cffunction name="createTableMySQL" access="public" output="false"
> returntype="struct" hint="Create table; MySQL.">
>     <cfargument name="bDropTable" default="true" type="boolean" hint="Flag
> to drop table before creating." />
>     <cfset var stReturn = structNew() />
>
> *    <cfquery datasource="#variables.dsn#" name="qCheck">
>         SHOW TABLES LIKE 'fqAudit'
>     </cfquery>
>
>     <cfset result = ArrayNew(1)>
>
>     <cfif IsDefined("qCheck.RecordCount") AND qCheck.RecordCount eq 1>
>         <cfset result[1] = 1>
>     <cfelse>
>         <cfset QueryNew('qCheck')>
>         <cfset QueryAddRow(qCheck)>
>         <cfset result[1] = 0>
>     </cfif>
>     <cfset temp = QueryAddColumn(qCheck,'tblExists',result)>*
>
>             <cfquery datasource="#variables.dsn#" name="qDrop">
>                 DROP TABLE if exists #application.dbowner#fqAudit
>             </cfquery>
>
>             <!--- create the audit tables --->
>             <cfquery datasource="#variables.dsn#" name="qCreate">
>                 CREATE TABLE #application.dbowner#fqAudit (
>                     AuditID char (50) NOT NULL ,
>                     objectid char (50) NULL ,
>                     datetimeStamp datetime NOT NULL ,
>                     username varchar (255) NOT NULL ,
>                     location varchar (255) NULL ,
>                     auditType char (50) NOT NULL ,
>                     note varchar (255) NULL,
>                     PRIMARY KEY(AuditID)
>                 )
>             </cfquery>
>
>     <cfreturn stReturn />
> </cffunction>
>
> Compared to *refobjects.cfc*
>
> <cffunction name="createTableMySQL" access="public" output="false"
> returntype="struct" hint="Create table; MySQL.">
>     <cfargument name="bDropTable" default="true" type="boolean" hint="Flag
> to drop table before creating." />
>     <cfset var stReturn = structNew() />
>
>     <cfif arguments.bDropTable>
>         <cfquery datasource="#variables.dsn#">
>             DROP TABLE IF EXISTS #variables.dbowner#refObjects
>         </cfquery>
>     </cfif>
>
>     <cfquery datasource="#application.dsn#">
>         CREATE TABLE refObjects (
>         objectid VARCHAR(50) NOT NULL,
>         typename VARCHAR(50) NOT NULL,
>         PRIMARY KEY (objectid)
>         )
>     </cfquery>
>
>     <cfreturn stReturn />
> </cffunction>
> --
> AJ Mercer
> Web Log:http://webonix.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to