> which is the primary key. Now when I call my update(form)
> method it looks for the primary key field and generates the
> SQL code necessary for the update based on the datatypes (ie
> if string datatype wrap quotes around it, etc).
Now this I'm interested in. I've tried using the getMetaData method, and all
it's corresponding properties and methods with little luck. In fact the
isXXX (isNullable, isAutoIncrement etc) are totally broken in CFMX, as I
pointed out to several MM engineers at MAX this year :). How do you go about
determining all of your field properties? This has always been a cinch for
me in VBScript, but all of these undocumented features of CF really
frustrate me some days. Here's an example that I worked on before giving up
on the isXXX methods.
<cfscript>
metadata = rsCompanyInfo.getMetaData();
</cfscript>
<cfdump var="#metaData#" label="metaData">
<cfscript>
colCount = metaData.getColumnCount();
for(i=1;i LTE colCount;i=i+1){
i = javaCast("int", i);
writeoutput("<h3>" & metaData.getColumnName(i) & "</h3>");
writeoutput("<ul>");
writeoutput("<li>" &
rsCompanyInfo.getColumnTypeName(metaData.getColumnType(i)) & "</li>");
writeoutput("<li>Nullable: " & rsCompanyInfo.isAutoIncrement(i) &
"</li>");
//Jim Schley filed bug on unsupported methods. Verified source. The
"is" functions
//are improperly called in the CF source code, and return an error
instead of false
writeoutput("</ul>");
}
colID = rsCompanyInfo.findColumn('comp_ID');
colType = metadata.getColumnType(colID);
</cfscript>
I was going to use a good part of that to build a script to generate a group
of INSERT statements to do basically a "dirty backup" of a database, that I
could use against another database. But in order to do that I have to be
able to find all the properties on a field but simply looping through the
sysobjects table in SQL Server, and then dynamically scripting out each
table...
Dan
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
[EMAIL PROTECTED]