Displaying 5 results from an estimated 5 matches for "fetch_row".
Did you mean:
fetch_ret
2013 Mar 07
1
HELP:Custom function didn't work
...quot;) do |args|
dbh = Mysql.real_connect("mysql_server_ip", "username", "password",
"puppet")
res = dbh.query("SELECT host_type FROM host_extra_info where
name=''" + args[0] + "''")
# return res.fetch_row
puts res.fetch_row
res.free
dbh.close if dbh
end
end
- Also I wrote a .pp file to test it:
#/tmp/1.pp
$extraaaaa = hosttype("my_hostname")
notify { $extraaaaa: }
Test results(the red value is the query result from db):
[root@pm tmp]# pupp...
2006 May 23
8
ad-hoc query
How do you run an ad-hoc query that does not belong in any model? I
thought it was something like ActiveRecord::connection.find("my
query..."), but I can''t seem to find the documentation on it. I know
I''ve seen it somewhere before, though.
thanks,
Jeff
--
Posted via http://www.ruby-forum.com/.
2008 May 30
9
find_by_sql without a model? how to do this?
Hi,
I''d like to do a "find_by_sql" without a model (e.g. <model
name>.find_by_sql("...")) as the results I get back are a once off special,
and I''m happy to handle them as an array. How do I do this?
"ActiveRecord::Base.find_by_sql(...)" does not seem to work?
Background - At the moment I''m doing within a model <model_name>,
2006 Mar 14
3
ActiveRecord row-by-row processing
I want to use ActiveRecord outside of Rails to do processing on large
tables. I want to be able to process the rows as they are retrieved
rather than having to store the results in an intermediate array.
Any suggestions?
Looks like I could hack the adapter to provide an accessor to the
underlying DBI handle. Anything cleaner than that?
2005 Sep 23
1
Sortable list with Ajax and delete function - working example
Hi.
I read most of the postings here but unfortunately I didin''t found a complete example which could be used. Of cource the ones who are professionals in javascript could implement the missing peaces from the puzzle.
What I''m required to do is a tree (sortable list) where items can also be deleted and at each modification a function (ajax) is called to save the changes. For