[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessInit AddField.cfm,1.3,1.4
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-11 03:52:08
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit In directory sc8-pr-cvs1:/tmp/cvs-serv2313/dbProcessInit Modified Files: AddField.cfm Log Message: Functionality Added: [ 752344 ] Created alterSpec Array of Structure In file dbProcessInit/AddField.cfm Created alterSpec Array of Structure - Created a Structure for each new field - Created Structure Key "type" - Created Structure Key "colName" Index: AddField.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit/AddField.cfm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AddField.cfm 11 Jun 2003 03:05:05 -0000 1.3 --- AddField.cfm 11 Jun 2003 03:52:04 -0000 1.4 *************** *** 11,15 **** <!--- Initiate a Read Only lock to ensure the integrity of session variables ---> <cflock timeout=20 throwontimeout="no" type="readonly" scope="SESSION"> ! <!---||| Get List of Field Names and Their Properties |||---> <cfmodule template="../Query/fieldList.cfm" queryName="fieldList" --- 11,17 ---- <!--- Initiate a Read Only lock to ensure the integrity of session variables ---> <cflock timeout=20 throwontimeout="no" type="readonly" scope="SESSION"> ! <!----------------------------------------------------> ! <!--- Get List of Field Names and Their Properties ---> ! <!----------------------------------------------------> <cfmodule template="../Query/fieldList.cfm" queryName="fieldList" *************** *** 17,29 **** username="#SESSION.userName#" password="#SESSION.password#" ! table="#URL.table#"> ! <!---||| Create alterSpec Definition |||---> <!--- Create alterSpec one dimensional array ---> ! <cfset alterSpec=ArrayNew(1)> ! ! <!--- Loop over FORM ---> <!---||| If execution of Alter Table was requested by the form ... |||---> <cfif IsDefined("FORM.ExecuteAlterTable")> --- 19,42 ---- username="#SESSION.userName#" password="#SESSION.password#" ! table="#URL.table#" /> ! <!-----------------------------------> ! <!--- Create alterSpec Definition ---> ! <!-----------------------------------> <!--- Create alterSpec one dimensional array ---> ! <cfset alterSpec=ArrayNew(1) /> + <!---||| Loop over each new field |||---> + <cfloop from="1" to="#FORM.numberOfFields#" index="i"> + <!--- Create a Structure for each new field ---> + <cfset alterSpec[i]=StructNew() /> + <cfset alterSpec[i].type="ADD COLUMN" /> + <cfparam name="FORM.fieldName#i#" default="" /> + <cfset alterSpec[i].colName="#Evaluate("FORM.fieldName#i#")#" /> + </cfloop> + <!-------------------------------------------------> + <!--- Invoke alterTable Custom Tag via CFModule ---> + <!-------------------------------------------------> <!---||| If execution of Alter Table was requested by the form ... |||---> <cfif IsDefined("FORM.ExecuteAlterTable")> |