I just recently upgraded from CF5 to CFMX7. The following code worked perfect in CF5 with no problems but no longer works in CFMX7. At the bottom you will see that my query value that has a single quote around it, is now being returned with 2 single quotes in place of one. The code is filled with additional functions, I removed them and left the relevant data. Any help would be greatly appreciated.
<cfscript>
.
.
Map.Request.WorkDesc = StructNew();
Map.Request.WorkDesc.FieldName = "work_desc";
Map.Request.WorkDesc.NoteId = "RLW3";
.
.
{a couple of functions in this area}
function GetGenericRequestEvent_CreateTheSQLStatement (NoteTable, ItemTable, ItemName, ItemOperation, ItemValue, FieldName, NoteId) {
var theSqlStatement = "";
theSqlStatement = "
SELECT
DISTINCT(n.note_id),
n.text,
n.row_index
FROM "
& NoteTable & " n, "
& ItemTable & " i
WHERE
i." & ItemName & ItemOperation & ItemValue & "
AND n.request_id = i.request_id
AND i." & FieldName & " = n.note_id
AND n.note_index = '" & NoteId & "'
ORDER BY
n.row_index";
return(theSqlStatement);
}
</cfscript>
<!---here is what runs in the above sql query. The single quote is not being replaced with 2 single quotes in MX7. This code works fine in CF5---->
SELECT DISTINCT (n.note_id), n.text, n.row_index
FROM note_req n, request_log i
WHERE i.request_id = 989849
AND n.request_id = i.request_id
AND i.work_desc = n.note_id
AND n.note_index = ''RLW3''
ORDER BY n.row_index
<cfscript>
.
.
Map.Request.WorkDesc = StructNew();
Map.Request.WorkDesc.FieldName = "work_desc";
Map.Request.WorkDesc.NoteId = "RLW3";
.
.
{a couple of functions in this area}
function GetGenericRequestEvent_CreateTheSQLStatement (NoteTable, ItemTable, ItemName, ItemOperation, ItemValue, FieldName, NoteId) {
var theSqlStatement = "";
theSqlStatement = "
SELECT
DISTINCT(n.note_id),
n.text,
n.row_index
FROM "
& NoteTable & " n, "
& ItemTable & " i
WHERE
i." & ItemName & ItemOperation & ItemValue & "
AND n.request_id = i.request_id
AND i." & FieldName & " = n.note_id
AND n.note_index = '" & NoteId & "'
ORDER BY
n.row_index";
return(theSqlStatement);
}
</cfscript>
<!---here is what runs in the above sql query. The single quote is not being replaced with 2 single quotes in MX7. This code works fine in CF5---->
SELECT DISTINCT (n.note_id), n.text, n.row_index
FROM note_req n, request_log i
WHERE i.request_id = 989849
AND n.request_id = i.request_id
AND i.work_desc = n.note_id
AND n.note_index = ''RLW3''
ORDER BY n.row_index