Thanks, worked like a charm.

Been using nothing but stored procs for awhile; forgot about that gotcha.

Matthew P. Smith 
Web Developer, Object Oriented 
Naval Education & Training Professional 
Development & Technology Center 
(NETPDTC) 
(850)452-1001 ext. 1245 
[EMAIL PROTECTED] 


>>-----Original Message-----
>>From: Kelly Tetterton [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, July 31, 2002 4:05 PM
>>To: [EMAIL PROTECTED]
>>Subject: RE: Can you use <cfqueryparam> with an insert?
>>
>>Don't quote the cfqueryparam; ie do
>>
>>Values        (<cfqueryparam value="#attributes.SSN#"
>>cfsqltype="CF_SQL_VARCHAR" maxlength="50">,
>>
>>rather than
>>
>>Values        ('<cfqueryparam value="#attributes.SSN#"
>>cfsqltype="CF_SQL_VARCHAR" maxlength="50">',
>>
>>-----Original Message-----
>>From: Smith, Matthew P -CONT(DYN) [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, July 31, 2002 4:03 PM
>>To: CF-Talk
>>Subject: Can you use <cfqueryparam> with an insert?
>>
>>
>>I try to use cfqueryparam for a little better performance(I'll be
>>converting
>>to a stored proc in a bit).
>>
>>I've used it with no prob for selects, but can you use it for an INSERT or
>>UPDATE statement?
>>
>>After running the query below, the DB is storing an actual "?" for the
>>values, rather than the actual values sent.  The debug info shows the
>>correct values being sent.
>>
>>
>><cfquery name="qry_insertNew" datasource="deersData" dbtype="ODBC">
>>                      INSERT INTO loginInfo (ssn, lastName, birthDate,
>>lastVerified)
>>                      Values  ('<cfqueryparam value="#attributes.SSN#"
>>cfsqltype="CF_SQL_VARCHAR" maxlength="50">', '<cfqueryparam
>>value="#attributes.lastName#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">',
>>'<cfqueryparam value="#attributes.birthdate#" cfsqltype="CF_SQL_VARCHAR"
>>maxlength="50">', #CreateODBCDateTime(now())#)
>></cfquery>
>>
>>
>>DEBUG INFO:
>>
>>qry_insertNew (Records=0, Time=16ms)
>>SQL =
>>INSERT INTO loginInfo (ssn, lastName, birthDate, lastVerified, hits)
>>                      Values  ('?', '?', '?', {ts '2002-07-31 16:00:41'},
>>?)
>>
>>Query Parameter Value(s) -
>>Parameter #1 = 123456789
>>Parameter #2 = Davis
>>Parameter #3 = 19430214
>>Parameter #4 = 1
>>
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to