Even though I don’t know why this makes a difference, I’ve added it to field.cfc.  I’ll check this in in a while.

 

Doug

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gareth Cole
Sent: Friday, February 10, 2006 3:52 PM
To: [email protected]
Subject: RE: Reactor For CF error with default column values

 

Thanks – it works now

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Porter, Benjamin L.
Sent: 10 February 2006 20:47
To: '[email protected]'
Subject: RE: Reactor For CF error with default column values

 

We ran into this occasionally also.  We hacked the field.cfc to get around this. I have a few ideas why this happens, but no testable examples atm.

 

Field.cfc Line 108 add default="" to

 <cfargument name="default" hint="I am the default value of this field" required="yes" default="" type="string" />

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gareth Cole
Sent: Friday, February 10, 2006 2:22 PM
To: [email protected]
Subject: Reactor For CF error with default column values

Hi Folks,

 

I've only just joined this list, so my apologies if this has already been answered.

 

I used the following script to create a table:

CREATE TABLE guestbook (

      guestbookID int IDENTITY(1,1) PRIMARY KEY CLUSTERED,

      creationDate datetime NOT NULL DEFAULT GETDATE(),

      modifiedDate datetime NOT NULL DEFAULT GETDATE(),

      active bit NOT NULL DEFAULT 1,

      guestName nvarchar(255) NOT NULL DEFAULT '',

      message ntext NOT NULL DEFAULT '',

      cfid int NULL,

      ip varchar(15) NULL,

      acceptLanguage varchar(255) NULL,

      countryCode char(2) NULL,

      countryName nvarchar(255) NULL

)

 

When I try the following code:

GuestbookRecord = reactor.createRecord("Guestbook");

 

It gives the following error:

The parameter DEFAULT to function setDefault is required but was not passed in.

  The error occurred in C:\CFusionMX7\components\Reactor\data\mssql\ObjectDao.cfc: line 78
Called from C:\CFusionMX7\components\Reactor\data\mssql\ObjectDao.cfc: line 8
Called from C:\CFusionMX7\components\Reactor\core\objectFactory.cfc: line 104
Called from C:\CFusionMX7\components\Reactor\core\objectFactory.cfc: line 29
Called from C:\CFusionMX7\components\Reactor\reactorFactory.cfc: line 15
Called from C:\sites\glasgowwindband.co.uk\www\_view\vTheBand\vGuestbook\dsp_questbookEntries.cfm: line 3
Called from C:\sites\glasgowwindband.co.uk\www\parsed\guestbook.view.cfm: line 31
Called from C:\sites\glasgowwindband.co.uk\www\parsed\guestbook.view.cfm: line 1
Called from C:\sites\glasgowwindband.co.uk\www\fusebox4.runtime.cfmx.cfm: line 433
Called from C:\sites\glasgowwindband.co.uk\www\fusebox4.runtime.cfmx.cfm: line 426
Called from C:\sites\glasgowwindband.co.uk\www\fusebox4.runtime.cfmx.cfm: line 1
Called from C:\sites\glasgowwindband.co.uk\www\index.cfm: line 5

76 :                   <cfset Field.setCfSqlType(getCfSqlType(qFields.dbDataType)) />
77 :                   <cfset Field.setLength(qFields.length) />
78 :                   <cfset Field.setDefault(getDefault(qFields.default, Field.getCfDataType(), Field.getNullable())) />
79 :                   
80 :                   <!--- add the field to the table --->

 

 

If I remove the default values from the table creation script it works fine.

 

I've tried the ReactorBlog sample app and it seems to work ok and also uses getdate() defaults.

 

Any suggestions?

 

Thanks,

 

Gareth

****************************************************************************

This email may contain confidential
material. If you were not an intended recipient,
Please notify the sender and delete all copies.
We may monitor email to and from our network.

 ***************************************************************************

 

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to