diecasthft01
asked on
Specifying number of rows in a CFLOOP query
Good morning everyone...I have a question/problem which I hope is simple but I'm having a hard time coming up with a solution., I have a simple query, and that query will return several rows of information about a specific project. Each row has a specific id number. I can display the query results using CFLOOP and everything works fine. But what I want to do is a) only show three records (the last three entered) instead of every records and then b) have a button or link where the user can select to show the remaining records. My query is below:
<CFQUERY DATASOURCE="MCA_Oracle" NAME="GetExcludeCurDocComm entList">
SELECT UNOB_REMARKS.*
FROM MCA.UNOB_REMARKS
WHERE UNOB_REMARKS.MIPR_ID = '#SESSION.urlpass.MIPR_ID# '
ORDER BY UNOB_REMARKS.LAST_REMARK_U PDATE DESC
</CFQUERY>
and then all I'm doing with the CFLOOP is:
<TABLE>
<CFLOOP query="GetExcludeCurDocCom mentList">
<TR>
<TD><CFINPUT TYPE="Text"
NAME="Exs_DATE"
VALUE="#DateFormat(GetExcl udeCurDocC ommentList .LAST_REMA RK_UPDATE, 'mm/dd/yyy y')#"
SIZE="12"
MAXLENGTH="25"
style="border-color:WHITE; border-width:2; background-color:D1D0CE" readonly="Yes"></TD>
<TD><textarea rows="2" cols="73" name="Exs_Remark" style="border-color:WHITE; border-width:2; background-color:D1D0CE" readonly>#GetExcludeCurDoc CommentLis t.REMARKS# </textarea ></TD>
<TD><CFINPUT TYPE="Text"
NAME="Exs_ID"
VALUE="#GetExcludeCurDocCo mmentList. ID#"
SIZE="5"
MAXLENGTH="25"
style="border-color:WHITE; border-width:2; background-color:D1D0CE" readonly="Yes"></TD>
</tr></CFLOOP></TABLE>
Any help would be greatly appreciated!!!
<CFQUERY DATASOURCE="MCA_Oracle" NAME="GetExcludeCurDocComm
SELECT UNOB_REMARKS.*
FROM MCA.UNOB_REMARKS
WHERE UNOB_REMARKS.MIPR_ID = '#SESSION.urlpass.MIPR_ID#
ORDER BY UNOB_REMARKS.LAST_REMARK_U
</CFQUERY>
and then all I'm doing with the CFLOOP is:
<TABLE>
<CFLOOP query="GetExcludeCurDocCom
<TR>
<TD><CFINPUT TYPE="Text"
NAME="Exs_DATE"
VALUE="#DateFormat(GetExcl
SIZE="12"
MAXLENGTH="25"
style="border-color:WHITE;
<TD><textarea rows="2" cols="73" name="Exs_Remark" style="border-color:WHITE;
<TD><CFINPUT TYPE="Text"
NAME="Exs_ID"
VALUE="#GetExcludeCurDocCo
SIZE="5"
MAXLENGTH="25"
style="border-color:WHITE;
</tr></CFLOOP></TABLE>
Any help would be greatly appreciated!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't forget to wrap it in a val() to protect against sql injection , ie val(url.maxRows)
ASKER