search for: _sql

Displaying 3 results from an estimated 3 matches for "_sql".

Did you mean: _sel
2006 Aug 22
5
Creating mysql triggers with migrations blows up
def self.up execute("delimiter ^ ") sql = <<-_SQL CREATE TRIGGER customer_bi BEFORE INSERT ON customers FOR EACH ROW BEGIN SET NEW.sndx = SOUNDEX(NEW.lname) ; END ^ _SQL sql.split(''^'').each do |stmt| execute(stmt) if (stmt.strip! && stmt.length > 0) end ex...
2006 Jan 19
2
NOOB: Using locals to pass data to a SQL query
...:id => entry %></td> <td><%= link_to ''Delete'', { :action => ''destroy'', :id => entry }, :confirm => ''Are you sure?'' %></td> </tr> <% end %> Model: def self.mine find_by_sql("select entries.id, species.name, length,species.multiplier*length as score,caught_on from entries join species on species_id = species.id where user_id = ? order by score DESC", myfish) end Basically I am trying to get the current value of session[:user].id into the find_b...
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
lets say i have the following SQL in my database editor : When i paste it into rad rails i have to add quotes and the ''+'' symbol to the end of each line. It is very tedious. What is the best method? select timesheets.employee, sum(items.hours) as hours, sum(items.hours*timesheets.cost) as cost, sum(items.hours*timesheets.charge*decode(activities.chargetype,0,1,0)) as charge,