Last active
September 28, 2015 19:22
-
-
Save byronferguson/ecf87d7b77c2a834a104 to your computer and use it in GitHub Desktop.
Hiddens not being stripped \r\n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component extends="taffy.core.resource" taffy_uri="/students/{studentID:[0-9]+}/details" { | |
function get(required numeric studentID) { | |
try { | |
var proc = new storedProc(); | |
//proc.setDatasource( "MyCCMajors" ); | |
proc.setProcedure("generateReportDetailsByID"); | |
proc.addParam(value=arguments.studentID, cfsqltype="cf_sql_integer"); | |
proc.addProcResult(name="rs1", resultset="1"); | |
var result = proc.execute(); | |
} | |
catch(any e) { | |
return rep([e.message]).withStatus(500, "Query Failed"); | |
} | |
var resultset = result.getProcResultSets().rs1; | |
if(resultset.recordCount) { | |
return rep(queryToArray(resultset)).withStatus(200, "OK"); | |
} | |
else { | |
return noData().withStatus(204, "No Student Found"); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"hsStatus": "Completed high school, diploma/GED\r\n", | |
"firstName": "Byron", | |
"collegeStatus": "", | |
"hsGradYear": "", | |
"birthdate": "", | |
"ethnicity": "White / Caucasian\r\n", | |
"hsSchoolID": "", | |
"collegeCredits": 32, | |
"asvabScore": "", | |
"collegeID": "", | |
"hsGradeLevel": "Graduate", | |
"gpaScale": 4, | |
"satScore": 1350, | |
"xfer": 1, | |
"lastName": "Ferguson", | |
"schoolLevel": "Not Attending", | |
"actScore": 31, | |
"gender": "Male", | |
"id": 459, | |
"otherStatus": "Some college credits earned, but not currently in college\r\n", | |
"currentGPA": 3 | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER FUNCTION getSelectedOptionResponseByStudent | |
( | |
@qID int, | |
@studentID int | |
) | |
RETURNS nvarchar(MAX) | |
AS | |
BEGIN | |
-- Declare the return variable here | |
DECLARE @oText nvarchar(MAX); | |
SET @oText = (SELECT iqot.interviewQuestionOptionText AS oText | |
FROM srt | |
INNER JOIN iqot | |
ON (srt.interviewQuestionOptionID = iqot.interviewQuestionOptionID) | |
AND (srt.studentID = @studentID) | |
AND (iqot.interviewQuestionID = @qID)); | |
RETURN REPLACE(REPLACE(@oText, '\r', ''), '\n', ''); | |
END | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment