similar to: How to run direct DML (insert or update)

Displaying 20 results from an estimated 100 matches similar to: "How to run direct DML (insert or update)"

2006 Jul 27
5
Calculate methods on attr_accessor objects
Is it possible to use the calculate methods (sum, etc.) on attr_accessor attributes? Ie: Class Item < ActiveRecord::Base attr_accessor :total_cost def total_cost @total_cost = self.cost_unit * self.amount end calling Item.sum(:total_cost) or Item.sum(''total_cost'') both return a unknown column ''total_cost'' mysql error. I thought that active
2006 May 08
2
On the speed of apply and alternatives?
Dear all, I have to handle a large matrix (1000 x 10001) where in the last column i have a value that all the preceding values in the same row has to be compared to. I have made the following code : # generate a (1000 x 10001) matrix, testm # generate statistics matrix 1000 x 4: qnt <- c(0.01, 0.05) cmp_fun <- function(x) { LAST <- length(x) smpls <- x[1:(LAST-1)] real
2006 Mar 05
0
Can I execute DML from within Rails?
Is it possible to execute a DML statement against a MySQL database from within Rails? I have a table I''m using for batch processing. It needs to be truncated to reset the primary key before each batch insert statement. I looked at the API here: http://api.rubyonrails.com/classes/ActiveRecord/ConnectionAdapters/DatabaseStatements.html#M000532 and didn''t notice anything that
2011 Jun 06
2
Wireframe, custom x-axis values
Hi, Im plotting some data with wireframe() like so: wireframe(result ~ u * r, myData, scales=list(arrows=FALSE)) However, I would really like to display something different for the displayed values of "u" rather than the actual values. This is because my u-values are a sequence of quantiles of myData, and I would like to display the quantiles used (e.g. "0.8 0.85 0.9
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about how I can get R to use all 8 cores of a mac pro would be most useful and very appreciated... (2) spent the last few hours trying to get pnmath to compile under os- x 10.5.4... using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from CRAN, xcode 3.0... ...xcode 3.1 installed over top of above after
2020 Aug 07
4
Saturating float-to-int casts
I have encountered a need for float-to-int casts that saturate to min/max when the value is out of the range of the target type. It seems that there is no intrinsic to do this, currently, but on IRC it was pointed out that a patch [1] has been proposed to implement this functionality in exactly the way that I was looking for. It looks like the discussion has died out but I was hoping maybe to
2008 Jan 30
0
Besoin d'un Financement rapide ?
[1]Si vous n'arrivez pas ? lire correctement ce message cliquez ici [2]Disponis le crdit selon vous [3][email-noel_02.gif] [4][email-noel_03.gif] [5][email-noel_04.gif] [6][email-noel_05.gif] [7][email-noel_06.gif]
2006 Aug 16
14
Migrations: only one table per migration file?
Hi all I have a new migration file created that adds some tables and fills one with some data: create_table :sound_styles do |t| t.column :name, :string, :null => false end create_table :show_types do |t| t.column :name, :string, :null => false end create_table :countries do |t| t.column :name, :string, :null => false end ActionView::Helpers::FormOptionsHelper::COUNTRIES.each
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks with the following messages: ---------------------------------------------------------------------- [...snip...] gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include
2006 Aug 17
3
Migrations for migrating data across databases - is it possible?
Hi All I am trying to understand if I can use migrations to migrate data under the following conditions 1. Across 2 different databases (Oracle/DB2) with same schemas. 2. Across 2 different databases (Oracle/DB2) with different schemas. I am trying to avoid writing DBI/OCI8 scripts. Can somone please shed some light if this is even possible? thanks -daya -------------- next part
2005 Dec 17
4
Rake migrate and creating join tables
Just wondering if there''s a way to use migrations to generate join tables (where the table columns comprise only of foreign keys to other tables, and where the primary key is all the foreign keys taken together). I made the changes manually in MySQL, then did rake db_schema_dump and it gave something like this: create_table "apples_oranges", :id => false, :force
2008 Jun 19
5
How do you create one session cookie for multiple subdomains
I am using the restful authentication plugin and am always prompted to login if a different subdomain is accessed. I have found a couple rails "solutions", but none of them seem to work: # development.rb 1. ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = ".localhost" 2. ActionController::Base.session_options[:key] = ".localhost" Does anyone
2009 Aug 11
4
func_odbc insert with mssql
I'm trying to use func_odbc to write to a MS SQL db. Here's my func_odbc conf: [OPTIN] dsn=MSSQL-Optin write=INSERT into OptIn (orgID) values (${VAL1}) Dial Plan exten => +18665551212,n,Set(ODBC_OPTIN()=dave) When I do an odbc show, it shows that I am connected to the db. If I use isql, I can write to the db, however, when I use func_odbc, a record will not write. I'm using
2009 Jan 21
2
CDR 0.00 duration
Hi I am using Trixbox 2.4 and PRI lines..on the CDR i see many calls that have duration of 0 seconds, but they are still shown as ANSWERED . how come its possible when duration is 0.00 ? Are the callers billed for such calls ? Rgds Sriram -------------- next part -------------- An HTML attachment was scrubbed... URL:
2015 Oct 29
1
vcenter convert OpenStack
HI: Dear all. I met a problem about libguest-tools, hope to get your help. even: OS: Fedora 22 rpm version: libguestfs-tools 1.30.3 vrit-v2v 1.30.3 problome: I convert a suse_guest from vcenter to the kvm. export LIBGUESTFS_BACKEND=direct suse_guest: file (suse.vmdk1 suse.my suse.ovf) step1. zip suse-disk1.vmdk.gz suse.my suse.ovf step2. virt-v2v -i ova
2005 Sep 07
0
using Oracle bind vars in Rails
Has anyone looked into having ActiveRecord use Oracle bind vars? I don''t know if the same concept is supported in other dbs, but Oracle''s OCI driver supports late binding with dramatically improved performance. I did a quick test to confirm that I could expect the same performance improvement through the Ruby OCI8 driver, and in a simple test it looks to be a 5x improvement.
2006 Apr 28
9
Q: Timing of render :update in an action ?
Hey folks, am hoping someone can set me straight with a solution to an issue that has come up involving the timing of rendered page elements in relation to the completion of an action''s execution. I have an ror search app which searches through two tables consisting of 7,000 page urls and a table w/ 87,000 related keyphrases within those pages. Search results can take anywhere from 2
2006 Feb 12
4
[newbie] if expression "weirdness"
Ok first i am running linux with lighttpd and apache proxy''ing to the lighttpd process. ruby version is ruby 1.8.4 (2005-12-24) [i686-linux] def test @count = Question.count if(@params[:id]) then breakpoint() if (params[:id].to_i > @count) then redirect_to :action => ''finish'' end end end this is a stripped down version of
2011 Mar 02
4
migrations in rails?
Are migrations used only when you''re making changes to a database? Does it just allow the developer to avoid using raw SQL when working with databases? -- Posted via http://www.ruby-forum.com/. -- 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
2004 Apr 21
0
Setting up dual WAN firewalling bridge
I currently have a 6mbit DSL line with a /28 block of static IP numbers. My DSL modem is in bridge mode, so I do not have a router. Because I dont want to put all my machines directly on the internet without some kind of firewall, I put a Linux machine between my DSL modem and my LAN, like this, DSL Modem --> eth0 Linux bridge/firewall/shaper eth1 --> LAN I need more bandwidth though