Hi,
I am trying to save myself some typing and I have a query from a db that
I want to import into my "reactor managed" db. The query has quite a few
columns and I was hoping I could do something like this:
<cfloop query="qNewProds">
<cfset pr = getReactorFactory().createRecord('products') />
<cfloop list="#qNewProds.columnlist#" index="i">
<cfset variables[pr & '.set' & i](i) />
</cfloop>
<cfset pr.save() />
</cfloop>
This is the line causing me problems:
<cfset variables[pr & '.set' & i](i) />
What I want the above to do is the equivalent of this:
<cfset pr.setColumnName(ColumnName) />
but using the columnlist to do it for each column in the query.
Can someone point me in the right direction?
Many thanks,
Dave
--
_______________________________________________________________________
David Phipps, Director
[EMAIL PROTECTED]
Chapel Studios / London
T +44 (0)20 7100 6980 F +44 (0)20 7100 6981 M +44 (0)7765 240899
New Broad Street House, 35 New Broad Street, London, EC2M 1NH, UK
Visit our website: http://www.chapel-studios.co.uk
_______________________________________________________________________
Chapel Studios is a limited company registered in England. The
information in this email is confidential, intended solely for the
addressee, and may be legally privileged. If you are not the addressee
or authorized to receive this for the addressee, you must not use,
copy,
disclose or take any action based upon this message or any information
herein. If you have received this message in error, please advise
the sender immediately by reply e-mail.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --