Displaying 3 results from an estimated 3 matches for "cl_spr".
Did you mean:
cl_opt
2006 Jan 26
1
Help constructing a find_by_sql command
Hello all. I am trying to do the equivalent of:
@componentlogs = Componentlog.find(:all,
:conditions => [ "cl_compname like ?", @criteria ],
:offset => offset,
:limit => items_per_page,
:order => "cl_spr DESC" )
in a find_by_sql statement. I cannot use the build in because the
adaptor isn''t quite right (OCI8)
When I use it I get the following error
OCIError: ORA-00907: missing right parenthesis: select * from (select
raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM componentlog WH...
2006 Jan 25
4
Cannot :order when using :offset and :limit in find
...pname like ?", @criteria ],
:offset => offset,
:limit => items_per_page )
However if I try and add an order...
@componentlogs = Componentlog.find(:all,
:conditions => [ "cl_compname like ?", @criteria ],
:offset => offset,
:limit => items_per_page,
:order => "cl_spr DESC" )
It goes totally doolally.
OCIError: ORA-00907: missing right parenthesis: select * from (select
raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM componentlog WHERE
(cl_compname like ''CAPODIR'') ORDER BY cl_spr DESC ) raw_sql_ where
rownum <= 25) where raw_rnum...
2006 Jan 16
8
AJAX + Table.
...tr>
</table>
CONTROLLER FUNCTION
def results
@componentlogs =
Componentlog.find_by_compname(params[:componentlog][:cl_compname]).reverse
render :partial=> "componentlog", :collection => @componentlogs
end
PARTIAL FORM
<tr>
<td><%=h componentlog.cl_spr %></td>
<td><%=h componentlog.cl_user %></td>
<td><%=h componentlog.cl_fromarea %></td>
<td><%=h componentlog.cl_date %> <%=h
componentlog.cl_date.to_formatted_s(:my_time) %></td>
<td><%=h componentlog.cl_status %><...