similar to: How to run direct sql

Displaying 20 results from an estimated 100 matches similar to: "How to run direct sql"

2006 Jan 17
9
Formatting a float with a set number of decimals
Another newbie question: How do i convert a float to a string, rounded to a certain number of decimals? Thanks -- Posted via http://www.ruby-forum.com/.
2006 Jul 26
7
Delete_all causes a deadlock on MSSQL database ???
Hi all, When i use the ''delete_all'' function to remove a few rows from my database, it causes a deadlock on the sql server. The delete seems to be successful, it then redirects to the ''view'' page, and the record does appear to be deleted as far as the ''view'' rails page shows. BUT if i go into sql query analyser, i can''t do a
2006 Feb 20
2
Problem with flash[:notice] appearing twice
In my save function in my (ajax!!!) controller, i''ve got a bit like this: if ... flash[:notice] = ''NOT SAVED: This month is locked'' render :partial => ''edit'' else save it... redirect to ''show'' action.... ... If i try to save an entry for a locked month, it correctly brings me back to my edit action with the
2024 Jan 30
1
R interpreting numeric field as a boolean field
Incidentally, "didn't work" is not very useful information. Please tell us exactly what error message or apparently aberrant result you received. Also, what do you get from: sapply(your_dataframe, "class") nrow(your_dataframe) (as I suspect what you think it is, isn't). Cheers, Bert On Tue, Jan 30, 2024 at 11:01?AM Bert Gunter <bgunter.4567 at gmail.com>
2024 Jan 30
1
R interpreting numeric field as a boolean field
Hi Bert, Below the information you asked me for: nrow(mydataset) [1] 2986276 ######## sapply(mydataset, "class") $`Transit Date` [1] "POSIXct" "POSIXt" $`Market Segment` [1] "character" $`N?mero de Tr?nsitos` [1] "numeric" $`Tar No` [1] "character" $`Beam Range (Operations)` [1] "character" $`Operational Vessel Ranges
2005 Dec 19
3
Trying to make an app helper
Any ideas with fixing this? Doesn''t work properly, although it doesn''t throw any runtime errors. # Methods added to this helper will be available to all templates in the application. module ApplicationHelper def options_for_months(selected_month)
2005 Dec 19
3
Where to put code - app controller, or app helper?
I have a function i want to be used in both views and controllers: def year_to_fiscal_year(year) # converts, say, an integer 2003 into ''0304'' year.to_s[2,2] << (year+1).to_s[2,2] end Where should i put it ? -- Posted via http://www.ruby-forum.com/.
2005 Dec 20
2
Designing a data-entry screen
Here''s what i''m trying to do: Have 3 dropdowns up the top of a page, being: year, month, department, and group. Also a button underneath that called refresh. When you click refresh, it finds the 1 row of data from the database for that year/month/dept/group and populates the fields into a set of textboxes below. Then you can edit what is in those textboxes, and click a
2024 Jan 30
1
R interpreting numeric field as a boolean field
Dear friend Duncan, Thank you so much for your kind reply. Yes, that is exactly what is happening, there are a lot of NA values at the start, so R assumes that the field is of type boolean. The challenge that I am facing is that I want to read into R an Excel file that has many sheets (46 in this case) but I wanted to combine all 46 sheets into a single dataframe (since the columns are exactly
2006 Jan 24
4
How to filter an activerecord find_all...
I have a nice hierarchical table structure like this: divisions has_many groups groups belongs_to division has_many subgroups subgroups belongs_to group has_many units units belongs_to subgroup I have a report which is based on units, but i want to be able to filter the units by which subgroup, or which group, or which division. I also want to sort them by division.name,then group.name,
2024 Jan 30
1
R interpreting numeric field as a boolean field
If you are using the read_excel() function from the readxl package, then there's an argument named col_types that lets you specify the types to use. You could specify col_types = "numeric" to read all columns as numeric columns. If some columns are different types, you should specify a vector of type names, with one entry per column. Allowable names are "skip",
2006 Mar 15
2
Using form_remote_tag, setting the form name
I''m using form_remote_tag like this: <%= form_remote_tag \ :update => "div_id_dataentry_bottom_ajax", :loading => "document.getElementById(''wait'').innerHTML=''Loading...'';", :url => { :action => "dataentry_bottom_edit" } %> And it makes this code: <form
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi, I know that to make a dropdown box automatically submit when you change the value, you do this: <select ..... onchange="this.form.submit();"> BUT i''ve got an ajax form, and if i do the above trick, it simply reloads the ajax partial into the whole screen, rather than into the div where it is meant to go. I''ve already got it all working so that if you click
2005 Dec 22
2
Accessing an instance variable by its name (as a string)
Hi (again!) I have a function which gets passed the name of an instance variable, and spits its out all nicely formatted. Just wondering, how do i access the variable, when all i have is its name stored as a string? So far i''ve got this code, but it looks horrible. Is there a better way? eval("@" << inst_var_name << "." << field_name <<
2010 Aug 13
0
some helpful tips on using RODBC
Hey everyone, I don't have a question. Instead some helpful advice with things I've learned from trying to connect 'R' to databases using RODBC. ROBDC is a very handy tool that, once you have everything fixed up nicely, is a great way to have scripts run fairly autonomously, safe in the knowledge that data isn't accidentally messed up. But I was fairly ignorant
2006 Apr 14
5
state_models plugin and file_column?
I was looking at Kyle Mawell''s extremely nifty-looking StateModels plugin http://www.kylemaxwell.com/articles/2006/02/06/fun-with-single-table-inheritance and before I go down the road with it, I was wondering if anyone has used it with file_column. The way file_column deals with an uploaded file -- by storing it to the filesystem in a path that employs the model name and id --
2006 Sep 03
9
using highlight from aaf
Hi, I''m trying to use highlight ferret method with trunk aaf and 0.10.1 ferret. In my search display I use: Myindexedclass.ferret_index.searcher.highlight(@query, result_line.id, :content) * searcher is a protected method; how can I access to the searcher from aaf ? * is the doc id in aaf the same as my model id ? * is the first param, query, the string query or the query object ?
2006 Mar 31
6
Split Validations?
I have a single table that two people enter data into. Person A creates the record and I need to specify certain required fields in his form. Person B has a separate form and she fills in additional fields and I need to specify that some of these are required. Since the data is all in one table and since the validations are in the model, won''t Rails complain when person A tries to
2009 Nov 25
1
implementing soundex algorithm
how can i implement soundex algorithm in rails app?? my database is mysql I want to search a particular table''s data using soundex -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send
2006 Jul 16
4
migrations questions: MySQL -> postgreSQL
I started my app before migrations were a best practice and have been using SQL scripts. Now I''m looking at potentially having to move from using MySQL to postgreSQL to use a particular hosting provider. I understand migrations are the way to go to make this ''easy'' but it also looks like the use of migrations introduces extra work in other areas. I''d really