Does any one have an example of a trigger that would do that? I have never written a trigger before.
 
Thanks,
 
Josh
 
 
 

------------------------------------------------
Joshua Scott
Resonant Media Technologies, LLC.
http://www.resonantmedia.com | http://blog.resonantmedia.com
 

"It is impossible to get out of a problem by using the same type of thinking that it took to get into the problem." -- Albert Einstein
 

 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Sims
Sent: Wednesday, July 19, 2006 8:32 AM
To: [email protected]
Subject: Re: [Reactor for CF] OT: Database Question

We have a nav and an org table that are recursive like this too, we are calling save twice as described above, as the overhead was low, but an advanced db guy I talked to said to put a trigger that would write the ID to the other field only if a null value was passed into the record, so I think that could be done if you really didnt want to call save twice.



On 7/18/06, Joshua Scott <[EMAIL PROTECTED]> wrote:
Right but wouldn't I have to call save() twice? This was the "easy" solution I was talking about.
 
Let me know,
 
- JS
 
 
 

------------------------------------------------
Joshua Scott
Resonant Media Technologies, LLC.
http://www.resonantmedia.com | http://blog.resonantmedia.com
 

"It is impossible to get out of a problem by using the same type of thinking that it took to get into the problem." -- Albert Einstein
 

 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Teddy Payne
Sent: Tuesday, July 18, 2006 9:40 PM
To: [email protected]
Subject: Re: [Reactor for CF] OT: Database Question

Using reactor, if you want to set another column with the default of the primary key of the same row, when you use the save() method, the primary key is populated into the primary key setter function of the record object.

So now that the primary key is populated into your object, just update the secondary column setter with the primary key getter for that record with the value.

Teddy


On 7/18/06, Joshua Scott <[EMAIL PROTECTED]> wrote:
Ok Database Gurus out there.

I have a parent / child navigation table. To signify a parent I want the
parentID field to be the value of the primary key and if it is a child then
parentID would have the value of its parent.

Doing it manually is easy. Is it possible to set the default value of the
parentID field to be the primary key of the row? My goal is that if reactor
does not enter a value for that field it would default to the pkey value.

I am using SQL Server 2000.

Thanks for the help,

Josh



------------------------------------------------
Joshua Scott
Resonant Media Technologies, LLC.
http://www.resonantmedia.com | http://blog.resonantmedia.com


"It is impossible to get out of a problem by using the same type of thinking
that it took to get into the problem." -- Albert Einstein




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




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


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

Reply via email to