my cfqueryparam grievance

2009-05-12 Thread Qing Xia
Hello folks, I had a pretty strange experience with CFQueryParam today. Basically, I have an innocent-looking query: cfquery datasource=#application.myDB# name=qGetUser *SELECT* username, password *FROM* someTable *WHERE* someID = cfqueryparam cfsqltype=CF_SQL_INTEGER value= #cookie.theID

Re: my cfqueryparam grievance

2009-05-12 Thread Ian Skinner
Qing Xia wrote: I simply cannot fathom why conversion was done and why it was necessary. Presumably not necessary, definitely undesirable as you describe it. But seeing that value 521636a makes me wonder if something is trying to interpret the value as a hexadecimal for some reason?

RE: my cfqueryparam grievance

2009-05-12 Thread brad
cached prepared statements before. ~Brad Original Message Subject: my cfqueryparam grievance From: Qing Xia txiasum...@gmail.com Date: Tue, May 12, 2009 2:16 pm To: cf-talk cf-talk@houseoffusion.com Hello folks, I had a pretty strange experience with CFQueryParam today

RE: my cfqueryparam grievance

2009-05-12 Thread Adrian Lynch
Start logging the value of COOKIE.theID. Just save it somewhere and see if it's ever an unexpected value. Adrian -Original Message- From: Qing Xia [mailto:txiasum...@gmail.com] Sent: 12 May 2009 20:16 To: cf-talk Subject: my cfqueryparam grievance Hello folks, I had

Re: my cfqueryparam grievance

2009-05-12 Thread Jason Fisher
Ummm, not sure why your cookie.theID would shift, but I would say absolutely that the CF_SQL_TYPE is designed to match the database column data type, not the incoming variable parameter. The entire point of the CF_SQL_TYPE is to let the JDBC driver handle the data pass-through for you in a

Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread BobSharp
I have been searching for some explanation of the different Types used in CFQueryParam. understand that SCALE= is used to validate the position of decimal, but still confused by ... FLOAT, DECIMAL, MONEY, MONEY4. I am using CFquery INSERT do I need to use CFQueryParam

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Francois Levesque
Hi Bob, Check here for a list of the available options and their corresponding data types for some major SQL providers (for some reason MySQL isn't there): http://www.cfquickdocs.com/cf8/#cfqueryparam. As for your question, generally using cfqueryparam is recommended for any value that could

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dave Watts
I have been searching for some explanation of the different  Types  used in  CFQueryParam. understand that SCALE=  is used to validate the position of decimal, but still confused by ...  FLOAT, DECIMAL,  MONEY, MONEY4. These correspond with specific database field types. You'd need to know

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Gerald Guido
bobsh...@ntlworld.com wrote: I have been searching for some explanation of the different Types used in CFQueryParam. understand that SCALE= is used to validate the position of decimal, but still confused by ... FLOAT, DECIMAL, MONEY, MONEY4. I am using CFquery INSERT do I need

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Gerald Guido
This is the link to the function code in case it was not apparent from my post... I really need to slow down. ;o) http://coz.pastebin.com/f588cde23 G! -- Gerald Guido http://www.myinternetisbroken.com http://www.cfsimple.org/ To invent, you need a good imagination and a pile of junk. --

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
I've always been curious as to how cfqueryparam works. Does anyone know if it just performs some scanning and filtering on the actual values of the parameters passed to it or whether it somehow signals to the RDBMS that the values are parameters to the query thereby treating an SQLI attack

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dave Watts
I've always been curious as to how cfqueryparam works. Does anyone know if it just performs some scanning and filtering on the actual values of the parameters passed to it or whether it somehow signals to the RDBMS that the values are parameters to the query thereby treating an SQLI attack

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Ian Skinner
Dave Watts wrote: it somehow signals to the RDBMS that the values are parameters to the query thereby treating an SQLI attack as an escaped string or something? It builds a prepared statement. It doesn't scan or filter anything. Thus the database knows the data is data and not

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
cfqueryparam works. Does anyone know if it just performs some scanning and filtering on the actual values of the parameters passed to it or whether it somehow signals to the RDBMS that the values are parameters to the query thereby treating an SQLI attack as an escaped string or something

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
cfqueryparam works. Does anyone know if it just performs some scanning and filtering on the actual values of the parameters passed to it or whether it somehow signals to the RDBMS that the values are parameters to the query thereby treating an SQLI attack as an escaped string or something

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
with Google ) that to do that within CFML I'd have to drop into Java and use the MySQL Java API to achieve that? On Thu, Apr 16, 2009 at 10:36 AM, Dave Watts dwa...@figleaf.com wrote: I've always been curious as to how cfqueryparam works. Does anyone know if it just performs some scanning

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Jason Fisher
And for all those reading this and using MSSQL, an inline statement would look like this: cfquery ... declare @p1 nvarchar(50) set @p1 = '#userSuppliedValue#' select * from tableName where column = @p1 /cfquery So, basically cfqueryparam is creating the Declare and Set for you

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Francois Levesque
Actually, I believe cfqueryparam uses bindings, which effectively passes parameters to the SQL engine. In your example, you are still open to SQL injection attacks. However, if you need to use your value several times, you can use declare / set to define a variable in SQL, rather than using

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Jason Fisher
Ah, yes, Francois, you are correct. I forgot to mention that in addition to creating the @var parameters (which you can see in the CF debug output), the CFQUERYPARAM also ensures that you don't get '; BAD SQL INJECTION' stuff getting through into your SET @p1 = '#myUserVar#' expression

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
:::It builds a prepared statement. It doesn't scan or filter anything. You could build a prepared statement yourself. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Are you sure? When I pass a string into a cfqueryparam of type cf_sql_integer I get the error: Invalid data etc

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
Just a little thing to add here is that I believe you should parametize all values in your query, whether user generated or constant values or whatever. This is not for security but performance. So: SELECT fu FROM bar WHERE barId = cfqueryparam cf_sql_type=cf_sql_integer value=#id# / AND live

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
/ Are you sure? When I pass a string into a cfqueryparam of type cf_sql_integer I get the error: Invalid data etc for CFSQLTYPE CF_SQL_INTEGER. Which leads me to believe it is being scanned/validated before being sent to MySQL, and also makes me wonder whether cfqueryparam even uses prepared

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Jason Fisher
getting cached. Not every value has to be a parameter, however, the query just has to be exactly the same. So, if it only ever looks like this: SELECT fu FROM bar WHERE barId = cfqueryparam cf_sql_type=cf_sql_integer value=#id# / AND live = 1 Then that will cache just fine, regardless of the value

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
Roger that re execution plans Jason, that makes perfect sense. Dominc 2009/4/16 Jason Fisher ja...@wanax.com: LECT fu FROM bar WHERE barId = cfqueryparam cf_sql_type=cf_sql_integer value=#id# / AND live = cfqueryparam cf_sql_type=cf_sql_bit value=1

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
Well from what I read today it seems like the performance is improved for reused prepared statements, which may not be how cfqueryparam is implemented. Prepared statements are stored and reused by name, passing in the values for the parameters. So if cfqueryparam is using prepared statements

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
Everything but your guess is correct ;) Dominic 2009/4/16 David McGuigan davidmcgui...@gmail.com: Well from what I read today it seems like the performance is improved for reused prepared statements, which may not be how cfqueryparam is implemented. Prepared statements are stored

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dave Watts
Are you sure? When I pass a string into a cfqueryparam of type cf_sql_integer I get the error: Invalid data etc for CFSQLTYPE CF_SQL_INTEGER. Which leads me to believe it is being scanned/validated before being sent to MySQL, and also makes me wonder whether cfqueryparam even uses prepared

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dave Watts
So if cfqueryparam is using prepared statements (which my guess would be that it's not), cfqueryparamming all of your variable values would improve performance because the statement itself isn't being re-sent to the RDMS on each subsequent query, only the values. But if it's not, it could

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Jason Fisher
I can't speak for MySQL, but in MSSQL, every query (not just prepared statements) is processed into a Query Plan before processing. The server then caches as many of these QPs as possible, so that repeated calls to the same 'query definition' do not have the overhead of having to re-generate

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
cffunctions. Thanks again. On Thu, Apr 16, 2009 at 1:33 PM, Dave Watts dwa...@figleaf.com wrote: So if cfqueryparam is using prepared statements (which my guess would be that it's not), cfqueryparamming all of your variable values would improve performance because the statement itself

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
if cfqueryparam is using prepared statements (which my guess would be that it's not), cfqueryparamming all of your variable values would improve performance because the statement itself isn't being re-sent to the RDMS on each subsequent query, only the values. But if it's not, it could actually

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
. This is worse than the fact that you can't use cfform controls outside of a cfform tag in CFC cffunctions. I don't believe it makes sense for CF to be able to do what you are asking. Given a bare cfqueryparam .../, how is it to know what to do with it? Dominic

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Dominic Watson
Sounds interesting :). Give all the googlers a bone and drop us a link or an explanation... 2009/4/16 David McGuigan davidmcgui...@gmail.com: Nevermind, you can totally hack cfquery! Woot. Thanks for all the help. ~| Adobe®

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread Matt Robertson
) cfqueryparam cfsqltype=#ListGetAt(attributes.SQLTypeList,variables.LoopCounter)# value=#ListGetAt(attributes.valueList,variables.LoopCounter)# null=#YesNoFormat(not Len(ListGetAt

Re: Newbie ... CFSQLTYPE of CFQueryParam

2009-04-16 Thread David McGuigan
So my real issue was that I wanted to super dynamically assemble the SQL and then either execute it or do a variety of other things with it ( which I won't go into ). If you try to use cfqueryparam outside of a containing cfquery, ColdFusion breaks. So, cfsavecontent ...cfqueryparam

Re: List of CfQueryParam cfsqltypes for TYPE_NAME as returned by cfdbinfo.

2009-03-23 Thread Gerald Guido
Most excellent. Just what I was looking for. Thank you sir! G! On Sun, Mar 22, 2009 at 10:54 PM, Dave Watts dwa...@figleaf.com wrote: BTW I was looking though my archive and I have a bunch of MySQL databases with the data type being Enum with either 0,1 or 'yes,no, true, false as the

List of CfQueryParam cfsqltypes for TYPE_NAME as returned by cfdbinfo.

2009-03-22 Thread Gerald Guido
Does anyone have a list of the SQL datatypes for MySQL and MSSQL as they are related to CfQueryParam cfsqltype when returned by cfdbinfo's TYPE_NAME? I am building a function to tease those out and want to make sure I get as many as I can matched up correctly. I thought I would ask here before

Re: List of CfQueryParam cfsqltypes for TYPE_NAME as returned by cfdbinfo.

2009-03-22 Thread Francois Levesque
Try this for MSSQL: http://www.cfquickdocs.com/cf8/#cfqueryparam. I have no idea why MySQL isn't on there, but it should at least get you started. Francois Levesque http://blog.critical-web.com/ On Sun, Mar 22, 2009 at 7:38 PM, Gerald Guido gerald.gu...@gmail.comwrote: Does anyone have

Re: List of CfQueryParam cfsqltypes for TYPE_NAME as returned by cfdbinfo.

2009-03-22 Thread Gerald Guido
Thanx... I wan't paying enough much attention or I would have noticed that Google gave me the 6.1 docs when I searched for CFSQLType Thanx G! On Sun, Mar 22, 2009 at 7:59 PM, Francois Levesque cfab...@gmail.comwrote: Try this for MSSQL: http://www.cfquickdocs.com/cf8/#cfqueryparam. I

Re: List of CfQueryParam cfsqltypes for TYPE_NAME as returned by cfdbinfo.

2009-03-22 Thread Dave Watts
BTW I was looking though my archive and I have a bunch of MySQL databases with the data type being Enum with either 0,1 or 'yes,no, true, false as the values. Seeing that enum can have more than 2 values and can be text values how do those work with cfsqltype? MySQL ENUM columns are

cfqueryparam with cfstoredprocparam

2009-03-06 Thread Scott Stewart
the arguments.login in cfqueryparam statements? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic

Re: cfqueryparam with cfstoredprocparam

2009-03-06 Thread Rob Parkhill
They currently look like this: cfprocparam type=in cfssqltype=cf_sql_varchar value=#arguments.login# null=no Do I still need to wrap the arguments.login in cfqueryparam statements? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835

RE: cfqueryparam with cfstoredprocparam

2009-03-06 Thread Adrian Lynch
No, cfprocparam is equivalent to cfqueryparam. Adrian -Original Message- From: Scott Stewart [mailto:sstwebwo...@bellsouth.net] Sent: 06 March 2009 15:10 To: cf-talk Subject: cfqueryparam with cfstoredprocparam Hey all, I'm calling a stored procedure using cfstoredproc

Re: cfqueryparam and LIKE operator error

2008-12-17 Thread Tom Chiverton
On Tuesday 16 Dec 2008, Mike Little wrote: WHERE #PreserveSingleQuotes(boolsearch)# Note that doesn't protect against SQL injection. -- Tom Chiverton Helping to dramatically reintermediate 24/7 low-risk cross-platform applications This

Re: cfqueryparam and LIKE operator error

2008-12-17 Thread JediHomer
Try wrapping the QueryParams... i.e. Change (P.product_code LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) to (P.product_code LIKE (cfqueryparam cfsqltype=cf_sql_varchar value=%tents%)) HTH 2008/12/16 Mike Little m...@nzsolutions.co.nz: hi guys, getting an error using

Re: cfqueryparam and LIKE operator error

2008-12-17 Thread CF Developer
It is as Dave suggested, you can not use CFQUERYPARAM as part of the actual SQL query. You are writting the WHERE clause as a variable, remove the queryparam from that since you are declaring the variable

cfqueryparam and LIKE operator error

2008-12-16 Thread Mike Little
hi guys, getting an error using the following syntax... WHERE ((P.product_code LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) OR (PD.product_title LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) OR (PD.product_description LIKE cfqueryparam cfsqltype=cf_sql_varchar value

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Jake Churchill
What does the rendered query transaction look like? It should be somewhere in the error dump. Mike Little wrote: hi guys, getting an error using the following syntax... WHERE ((P.product_code LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) OR (PD.product_title LIKE cfqueryparam

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Mike Little
INNER JOIN categories_description CD ON C.cid = CD.cid INNER JOIN brand B ON P.bid = B.bid WHERE ((P.code LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) OR (PD.ptitle LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%tents%) OR (PD.pdesc LIKE cfqueryparam cfsqltype=cf_sql_varchar value

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Matt Quackenbush
The generated SQL has the cfqueryparam tags in it There's something wrong with that picture. How are you writing that query? On Tue, Dec 16, 2008 at 3:13 PM, Mike Little wrote: jake this is the actual dump... SELECT P.pid, P.price, P.price_sale, P.bid, P.display, P.views, PD.ptitle

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Mike Little
ah, it comes from a function matt. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive:

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Mike Little
in my query, i have... WHERE #PreserveSingleQuotes(boolsearch)# boolsearch is a string that is generated based on the search string. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get

Re: cfqueryparam and LIKE operator error

2008-12-16 Thread Dave Watts
in my query, i have... WHERE #PreserveSingleQuotes(boolsearch)# boolsearch is a string that is generated based on the search string. You can only use CFQUERYPARAM within a query. You can't build a string with CFQUERYPARAM, then use it in a query. Dave Watts, CTO, Fig Leaf Software http

cfqueryparam vs cfstoredproc?

2008-10-30 Thread Marie Taylore
Question... the more I read about CFQUERYPARAM the more it seems it mitigates many of the problems that using stored procedures also solves. I realize with stored procedures you have a lot more power in terms of SQL scripting, but for basic queries, is CFQUERYPARAM just as fast as (or faster than

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Adrian Lynch
: cfqueryparam vs cfstoredproc? Question... the more I read about CFQUERYPARAM the more it seems it mitigates many of the problems that using stored procedures also solves. I realize with stored procedures you have a lot more power in terms of SQL scripting, but for basic queries, is CFQUERYPARAM just as fast

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread morgan l
We call stored procedures using cfqueryparam: cfquery datasource=DSN name=SomeQuery EXEC StoredProcName @ParamName = cfqueryparam cfsqltype=cf_sql_integer value=#session.value# /cfquery On Thu, Oct 30, 2008 at 10:49 AM, Marie Taylore [EMAIL PROTECTED]wrote: Question... the more I read about

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Alan Rother
The only issue I have run into with CFQUERYPARAM is that is can degrade performance on dynamic queries. This is an inherent issue in what CFQUERYPARAM does, it essentially makes your queries into stored procs, if you actually watch the traffic flow through a MS SQL Server for example, you will see

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Jason Fisher
Marie, In my experience with SQL Server there is zero notable performance difference between well-formed SQL in a stored proc and the same well-formed SQL in a CFQUERY with CFQUERYPARAM: both gain from the built-in performance tuning of the data server. Also, note that you can run nearly any

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread brad
Original Message Subject: cfqueryparam vs cfstoredproc? From: Marie Taylore [EMAIL PROTECTED] I realize with stored procedures you have a lot more power in terms of SQL scripting, This is not really true. You can put anything you want in a cfquery block. temp tables, CTE's

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread brad
Let's hope you don't ever need to handle more than one result set. :) Also, that requires you get the return code manually as well. ~Brad Original Message Subject: Re: cfqueryparam vs cfstoredproc? From: morgan l [EMAIL PROTECTED] We call stored procedures using

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Jason Fisher
query plan, and that increases performance. Without using CFQUERYPARAM at all, every instance of the query is 'new' and that should (in theory) kill your performance, not boost it. In other words, the following queries would have the same plan with params but are each 'new' and distinct without

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Alan Rother
performance. Without using CFQUERYPARAM at all, every instance of the query is 'new' and that should (in theory) kill your performance, not boost it. In other words, the following queries would have the same plan with params but are each 'new' and distinct without params: Query with last name

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Jason Fisher
Interesting, indeed. Wonder if there's an issue of table scan vs index and how the initial execution plans are getting cached. Definitely something to keep your eye on! Interesting... I thought the same thing until I ran these tests. I analyzed the results with ColdFusion debugging output,

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Mark Kruger
Something of note... If you are using cfqueryparam all of the variables need to be bound. Leaving any variable hanging out there will not allow you to take advantage of the execution plan - even if it's a constant. This query cfquery SELECT col1,col2 FROMusers WHERE

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Craigsell
benefits as CFQUERYPARAM. I'm a big believer in doing database things on the database and display stuff in the web server. I'll confess though that I don't use CF much anymore except for CFCs-- most everything I do is in Flex

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Adrian Lynch
) #column1# cfqueryparam cfsqltype=CF_SQL_INTEGER value=#ARGUMENTS.column1# cfset separator = , /cfif cfif StructKeyExists(ARGUMENTS, column2

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread brad
steps to paramaterize it. (requires sp_executesql) FYI: My advice assumes MS SQL. ~Brad Original Message Subject: RE: cfqueryparam vs cfstoredproc? From: Adrian Lynch [EMAIL PROTECTED] Date: Thu, October 30, 2008 1:06 pm To: cf-talk cf-talk@houseoffusion.com An open question

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Adrian Lynch
/ -Original Message- From: [EMAIL PROTECTED] Sent: 30 October 2008 18:28 To: cf-talk Subject: RE: cfqueryparam vs cfstoredproc? exec() or sp_executesql You would need to pass in the arguments as a list to the procedure and then do the looping and building of a dynamic query with SQL

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Aaron Rouse
: http://adrianlynch.co.uk/post.cfm?postID=21 Adrian Building a database of ColdFusion errors at http://cferror.org/ -Original Message- From: [EMAIL PROTECTED] Sent: 30 October 2008 18:28 To: cf-talk Subject: RE: cfqueryparam vs cfstoredproc? exec() or sp_executesql You would need

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Aaron Rouse
PROTECTED] Sent: 30 October 2008 18:28 To: cf-talk Subject: RE: cfqueryparam vs cfstoredproc? exec() or sp_executesql You would need to pass in the arguments as a list to the procedure and then do the looping and building of a dynamic query with SQL. Then execute what you have created. Good

RE: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Adrian Lynch
EXEC()ing a string won't produde the same execution plan as the base SQL (--- a guess) and you lose cfqueryparam and cfprocparam's biggest benefit, protecting against injection. Adrian -Original Message- From: Aaron Rouse Sent: 30 October 2008 19:52 To: cf-talk Subject: Re: cfqueryparam

Re: cfqueryparam vs cfstoredproc?

2008-10-30 Thread Aaron Rouse
in to hopefully avoid the possibility of a SQL injection attack. On Thu, Oct 30, 2008 at 2:57 PM, Adrian Lynch [EMAIL PROTECTED]wrote: EXEC()ing a string won't produde the same execution plan as the base SQL (--- a guess) and you lose cfqueryparam and cfprocparam's biggest benefit, protecting

CFQueryParam question

2008-10-28 Thread Scott Stewart
I have a variable passed though a URL that looks like this index.cfm?a=1,2,3 The variable a is passed to a SQL statement WHERE clause as part of an IN operator IE: WHERE b in (#url.a#). How would I encapsulate url.a in a CFQueryParam properly, is this a case where I wouldn't define

Re: CFQueryParam question

2008-10-28 Thread Nick G
cfqueryparam cfsqltype=cf_sql_integer value=#url.a# list=true separator=, Obviously you would need to change the sqltype to what your sql type is. On Tue, Oct 28, 2008 at 10:13 AM, Scott Stewart [EMAIL PROTECTED]wrote: I have a variable passed though a URL that looks like this index.cfm

Re: CFQueryParam question

2008-10-28 Thread Jason Fisher
WHERE b IN ( cfqueryparam cfsqltype=CF_SQL_VARCHAR value=#url.a# list=yes ) The list=yes parameter of CFQUERYPARAM will properly wrap the single quotes around each list element. -Jason I have a variable passed though a URL that looks like this index.cfm?a=1,2,3 The variable a is passed

RE: CFQueryParam question

2008-10-28 Thread Adrian Lynch
cfqp has a list attribute. Adrian Building a database of ColdFusion errors at http://cferror.org/ -Original Message- From: Scott Stewart Sent: 28 October 2008 17:13 To: cf-talk Subject: CFQueryParam question I have a variable passed though a URL that looks like this index.cfm?a=1,2,3

Re: CFQueryParam question

2008-10-28 Thread Eric Cobb
Try this: cfqueryparam value=#Trim(URL.a)# cfsqltype=cf_sql_varchar list=true / Thanks, Eric Cobb Scott Stewart wrote: I have a variable passed though a URL that looks like this index.cfm?a=1,2,3 The variable a is passed to a SQL statement WHERE clause as part of an IN operator IE

Re: CFQueryParam question

2008-10-28 Thread Dominic Watson
The list=yes parameter of CFQUERYPARAM will properly wrap the single quotes around each list element. That's not quite right. What it will do is create a parameter for every element in the list and map it to the database type you supply. Even with character data, no single quotes are used when

Cached Attributes and cfqueryparam

2008-10-20 Thread Hunsaker, Michael Scott
Hello - I'm reading conflicting reports and wanted to get some clarification. Adobe's website (CF8) says that you cannot use the cachedAfter and cachedWithin while using cfqueryparam. Is this true? I'm using CF8. Adobe says no but lots of users say yes. http://livedocs.adobe.com/coldfusion

Re: Cached Attributes and cfqueryparam

2008-10-20 Thread Azadi Saryev
you can in cf8 Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Hunsaker, Michael Scott wrote: Hello - I'm reading conflicting reports and wanted to get some clarification. Adobe's website (CF8) says that you cannot use the cachedAfter and cachedWithin while using cfqueryparam

RE: cfqueryparam within a cfc

2008-10-01 Thread Adrian Lynch
Add to that list, locally scope the query. cfset var get = Adrian -Original Message- From: Peter Boughton [mailto:[EMAIL PROTECTED] Sent: 01 October 2008 00:01 To: cf-talk Subject: Re: cfqueryparam within a cfc cfcomponet cffunction name=function cfargument name=field_value type

Re: cfqueryparam within a cfc

2008-10-01 Thread Peter Boughton
Add to that list, locally scope the query. cfset var get = Very good point - probably the most critical change to make. I can't believe I missed that. :'( ~| Adobe® ColdFusion® 8 software 8 is the most important and

RE: cfqueryparam within a cfc

2008-10-01 Thread Hunsaker, Michael Scott
: cfqueryparam within a cfc Add to that list, locally scope the query. cfset var get = Very good point - probably the most critical change to make. I can't believe I missed that. :'( ~| Adobe® ColdFusion® 8 software 8 is the most

cfqueryparam for boolean/tinyint columns

2008-09-30 Thread Jim McAtee
I have columns in MySQL database containing boolean values, using a data type of unsigned tinyint. Would the cfsqltype of cf_sql_tinyint or cf_sql_bit be best to use? If using cf_sql_bit what does cfqueryparam do in that case with values such as -1 or 3 - will it cast them to 1/0

cfqueryparam within a cfc

2008-09-30 Thread Hunsaker, Michael Scott
Hello - We are consistently using the CFQUERYPARAM tag in our code but not within out CFCs. Here's a quick example: cfcomponet cffunction name=function cfargument name=field_value type=numeric required=yes cfquery name=get SELECT * FROM TABLE WHERE field = cfqueryparam value

RE: cfqueryparam within a cfc

2008-09-30 Thread Adrian Lynch
Just use it all the time, then it's never an issue. Plus it does more than just protect against SQL injection. Adrian -Original Message- From: Hunsaker, Michael Scott [mailto:[EMAIL PROTECTED] Sent: 30 September 2008 21:21 To: cf-talk Subject: cfqueryparam within a cfc Hello - We

Re: cfqueryparam within a cfc

2008-09-30 Thread Josh Nathanson
No it's not overkill. You could be passing in the argument as a form or url scoped variable for example: cfinvoke component=mycomponent method=function field_value=#url.field_value# If you just cfqueryparam everything you don't have to worry about it. -- Josh - Original

Re: cfqueryparam for boolean/tinyint columns

2008-09-30 Thread Mary Jo Sminkey
I have columns in MySQL database containing boolean values, using a data type of unsigned tinyint. Would the cfsqltype of cf_sql_tinyint or cf_sql_bit be best to use? If using cf_sql_bit what does cfqueryparam do in that case with values such as -1 or 3 - will it cast them to 1/0

Re: cfqueryparam within a cfc

2008-09-30 Thread Peter Boughton
cfcomponet cffunction name=function cfargument name=field_value type=numeric required=yes cfquery name=get SELECT * FROM TABLE WHERE field = cfqueryparam value=#field_value# cfsqltype=cf_sql_integer /cfquery /cffunction /cfcomponent Is this over-kill or good practice? Use

cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread Les Mizzell
My original query code below, which has been running for months with no error, suddenly start throwing an unspecified database error today, plus actually timed out once, and the server reset in the middle of the query another time: Select ... from ... WHERE ml_id IN (cfqueryparam value

RE: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread Adrian Lynch
Mizzell [mailto:[EMAIL PROTECTED] Sent: 15 September 2008 21:37 To: CF-Talk Subject: cfqueryparam - couple ofquestions from a problem that occured today... My original query code below, which has been running for months with no error, suddenly start throwing an unspecified database error today

Re: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread Al Musella, DPM
Maybe you hit a limit in the number of items valuelist or cfqueryparam could handle. try building the string outside the query with valuelist, to see if the valuelist triggers an error.. then use that string with cfqueryparam in your query and if it doesn't work, try the string (just once

Re: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread Matt Quackenbush
I don't see where you specified the database you're using, but SQL Server will allow a limit of 2,100 records be used in the IN statement. I'm assuming that MySQL and other db servers have a similar limitation in place. ~|

RE: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread brad
not have that option... ~Brad Original Message Subject: cfqueryparam - couple ofquestions from a problem that occured today... From: Les Mizzell [EMAIL PROTECTED] Date: Mon, September 15, 2008 3:36 pm To: CF-Talk cf-talk@houseoffusion.com My original query code below, which

Re: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread Les Mizzell
I don't see where you specified the database you're using, but SQL Server will allow a limit of 2,100 records be used in the IN statement. It is SQL server. But, why did CFQUERYPARAM fail, and this works: WHERE ml_id IN (cfoutput query=getGROUP cfif getGroup.CurrentRow NEQ 1,/cfif

Re: cfqueryparam - couple ofquestions from a problem that occured today...

2008-09-15 Thread James Holmes
It failed because with cfqueryparam you're binding thousands of variables into the statement as parameters, which is a Very Bad Thing (TM). If it's all against the same DB, use a subquery for your IN clause. It should perform much better than either of the current solutions. On Tue, Sep 16, 2008

A Little Confusion on CFQUERYPARAM and Nulls...

2008-09-12 Thread Les Mizzell
For this: cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1, Two questions: 1. If #myFORM.myVAR# doesn't exist, what's the best way to set a null? This? cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1 null = #YesNoFormat

RE: A Little Confusion on CFQUERYPARAM and Nulls...

2008-09-12 Thread Dave Watts
For this: cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1, Two questions: 1. If #myFORM.myVAR# doesn't exist, what's the best way to set a null? This? cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1 null

RE: A Little Confusion on CFQUERYPARAM and Nulls...

2008-09-12 Thread Adrian Lynch
[mailto:[EMAIL PROTECTED] Sent: 12 September 2008 17:01 To: CF-Talk Subject: A Little Confusion on CFQUERYPARAM and Nulls... For this: cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1, Two questions: 1. If #myFORM.myVAR# doesn't exist, what's the best way to set

Re: A Little Confusion on CFQUERYPARAM and Nulls...

2008-09-12 Thread Qing Xia
, 2008 at 12:00 PM, Les Mizzell [EMAIL PROTECTED] wrote: For this: cfqueryparam value=#myFORM.myVAR# cfsqltype=CF_SQL_CHAR maxlength=1, Two questions: 1. If #myFORM.myVAR# doesn't exist, what's the best way to set a null? This? cfqueryparam value=#myFORM.myVAR# cfsqltype

<    1   2   3   4   5   6   7   8   9   10   >