On 2/25/03 5:07 AM, "Guy McDowell" <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Naive guy here...would cfinsert be suitable in this situation? Whih
> leads me to another question; which is more effective/efficient /?
> Cfinsert or an SQL insert statement?
cfinsert -- BAD
Learning SQL and how to use CFQUERYPARAM -- GOOD
Why would anyone ever want to use CFINSERT or CFUPDATE ??
If you anticipate changing the database engine underneath (from M$Access
to MySQL to SQLServer to Oracle to Sybase) you MAY want to use these tags
because they keep you from doing anything too tricky.
Why do I prefer NOT to use CF inserts & Updates?
Because they don't let you do anything too tricky! ;-) Coding database
inserts, deletes, and updates myself gives me more control. More chance
that I can figure out if something goes wrong.
SQL is also more portable on a resume
On 2/25/03 5:07 AM, "Guy McDowell" <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Naive guy here...would cfinsert be suitable in this situation? Whih
> leads me to another question; which is more effective/efficient /?
> Cfinsert or an SQL insert statement?
>
>
>
> Truly,
>
> Guy J. McDowell, M.M.C.P.
> (705) 324-9144 ex 3422
> [EMAIL PROTECTED]
> ~~~~~~~~~~~~~~~~~~~~
> Sir Sandford Fleming College
> Frost Campus
> P.O. Box 8000
> Lindsay, Ontario
> K9V 5E6
>
>
>>>> [EMAIL PROTECTED] 02/24/03 09:56AM >>>
> FlashGuy wrote:
>>
>> <cfquery name="qInsertData" DATASOURCE="results">
>> Insert into myresults
>> (strFileName, strCommand, strCreatedOn, strLastAcc, strLastMod,
> strSize, strDirectory, strDateCommand, strUsername)
>> VALUES
>> ('#Filename#', <cfqueryparam value="#strFilename#"
> cfsqltype="CF_SQL_LONGVARCHAR">)
>> ('#FileCommand#', <cfqueryparam value="#strCommand#"
> cfsqltype="CF_SQL_LONGVARCHAR">)
>>
>> ...and so on...
>>
>> </cfquery>
>
>> Is this the correct syntax?
>
> No: http://www.mysql.com/doc/en/INSERT.html
>
> <cfquery name="qInsertData" DATASOURCE="results">
> INSERT INTO myresults (
> strFileName,
> strCommand,
> strCreatedOn,
> strLastAcc,
> strLastMod,
> strSize,
> strDirectory,
> strDateCommand,
> strUsername
> )
> VALUES (
> <cfqueryparam value="#strFilename#"
> cfsqltype="CF_SQL_LONGVARCHAR">,
> <cfqueryparam value="#strCommand#" cfsqltype="CF_SQL_LONGVARCHAR">,
> ...,
> ...,
> ...,
> ...,
> ...,
> ...,
> ...
> )
> </cfquery>
>
>
>> Is there an easier way?
>
> No.
>
> Jochem
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4