There's an error in the directory field.  The very last set clause, with 
the query param, has a parameter but no field.  Reformatted this is easy to 
see:

UPDATE PPD
SET
         username = '#FORM.username#',
         password = '#FORM.password#',
         domain = '#domains.id#',
         <cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.directory#">
WHERE
         ID = #url.id#

There is no field on the cfqueryparam line.  I'd suggest formatting queries 
as above.

Also, cfqueryparam can also speed up your database calls.  Without 
cfqueryparam, cf sends these type of statements to the database:

UPDATE PPD SET username='user1', password='pass1', 
domain='domain1,  dir='dri1' WHERE id=1;
UPDATE PPD SET username='user2', password='pass2', 
domain='domain2,  dir='dri1' WHERE id=2;
UPDATE PPD SET username='user3', password='pass3', 
domain='domain3,  dir='dri1' WHERE id=3;

So the DB has to analyze each query and put together a query plan and 
execute the query.  The query plan generation is often most of time 
required to actually run a query.

By contrast, with cfqueryparam the database gets sql like this:

UPDATE PPD SET username=?, password=?, domain=?,  dir=? WHERE id=?;
UPDATE PPD SET username=?, password=?, domain=?,  dir=? WHERE id=?;
UPDATE PPD SET username=?, password=?, domain=?,  dir=? WHERE id=?;

with bind variables for each query.  The DB can reuse the query plan and 
only reexecutes the query with different values.

HTH,

Sam

At 02:13 PM 1/17/2003, you wrote:
>Not being mean, but how about doing yourself a favor and putting all the
><cfqueryparam> in there?  It'd save your time and ours.  With
>cfsqltype="..whatever.." being declared there's no mistake.
>
>~Todd
>
>At 07:09 PM 1/17/2003 +0000, you wrote:
> >Try this, same error different query...
> >
> >
> >     <cfquery ...>
> >     UPDATE PPD
> >     SET username = '#FORM.username#', password = '#FORM.password#', 
> domain =
> >'#domains.id#', <cfqueryparam cfsqltype="cf_sql_varchar"
> >value="#FORM.directory#">
> >     WHERE ID = #url.id#
> >     </cfquery>
> >
> >Im only using the queryparam for the directory as it needs to have '\'s in
> >it, everything else works fine without them....
> >
> >Username, password, domain, directory are all of type tinytext.
> >Id is of type tinyint(4).
> >
> >Ryan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to