Hello,
I am currently upgrading a huge ColdFusion5 project (over 1000 ColdFusion pages) to ColdFusion8, and have the following problem:
In ColdFusion5, you can specify a query like:
<CFQUERY Name="query1" DataSource="ds">
select *
from test
where name="something"
and type="test"
</CFQUERY>
Double-quoted SQL strings are allowed in CF5.
But in ColdFusion8, only single quoted SQL strings are accepted, so the above must be changed to:
<CFQUERY Name="query1" DataSource="ds">
select *
from test
where name='something'
and type='test'
</CFQUERY>
I want to use a perl script to run through all the files to find out where double-quoted strings are used in <cfquery> tag, but this is trickier than I thought because there might be other tags nested in <cfquery>...</cfquery> such as <cfif>, which might legitimately have double-quoted strings as attributes, such as:
<CFQUERY Name="query1" DataSource="ds">
select *
from test
where name='something'
<cfif typeIsSet = "true">
and type='test'
</cfif>
</CFQUERY>
Cases like this should NOT strike an alarm.
So, in English, I want to find out if there are double-quoted strings used within <cfquery> tags, which are NOT attributes of another tag.
Could some Perl Regexp guru give me a hand here?