So of I use:

select x,y,z from tbl where id=1
select x,y,z from tbl where id=2
select x,y,z from tbl where id=3

where id would be a dynamic variable,
I would not get any benefit in using cached query
but would see a benefit from cfqueryparam ?

Thanks,
Dave

  ----- Original Message -----
  From: Philip Arnold
  To: CF-Talk
  Sent: Monday, March 01, 2004 12:25 PM
  Subject: RE: SQL Multiple Inserts

  > From: Hugo Ahlenius
  >
  > Cached queries means storing the whole output query variable
  > in the cf server memory. CF does not touch the database. The
  > query can not have any dynamic variables (The SQL statement
  > has to be the same).
  >
  > Using cfqueryparam improves the caching on the db server side
  > (as described before). The cfquery will still need a
  > roundtrip to the database.
  >
  > So the first option is the fastest, but least flexible.

  The cached query is only useful if you're only getting one set of data,
  and it never changes, then the cached query is right

  If you've got loads of variation on the data, for example getting
  different records from the database, the CFQUERYPARAM is the way to go

  Of course, using SPs might be even faster than using CFQUERYPARAM, as
  long as your queries are never going to change
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to