similar to: Query result is array of elements, how to iterate over it ??

Displaying 20 results from an estimated 7000 matches similar to: "Query result is array of elements, how to iterate over it ??"

2007 Aug 30
1
belongs_to with foreign keys that reference non primary key columns
Hello, I have a situation where the foreign key into a table doesn''t correspond to that table''s primary key: my_table ------------- id (pk) name ... other_table -------------- id (pk) my_table_name (fk references my_table(name)) ... I want to be able to say something like: class OtherTable < ActiveRecord::Base belongs_to :my_table, :foreign_key => { :my_table_name
2010 Jun 10
1
Can RMySQL be used for a paramterized query?
I have not found anything about this except the following from the DBI documentation : Bind variables: the interface is heavily biased towards queries, as opposed > to general > purpose database development. In particular we made no attempt to define > “bind > variables”; this is a mechanism by which the contents of R/S objects are > implicitly > moved to the database during SQL
2008 Nov 28
1
True ActiveRecord result set iteration
Hello, For an internal project we were looking for a solution which extends ActiveRecord by an iterator function. Using find(:all) is no fun if you have to process some 10.000 records. Until now there have been two ways of dealing with that scenario: - write your logic a second times (e.g. use stored procedure) - bet on AR plugins which work around that limitation by fetching IDs and
2017 Sep 02
0
ganesha error ?
On 09/02/2017 02:09 AM, Renaud Fortier wrote: > Hi, > > I got these errors 3 times since I?m testing gluster with nfs-ganesha. > The clients are php apps and when this happen, clients got strange php > session error. Below, the first error only happen once but other errors > happen every time a clients try to create a new session file. To make > php apps work again, I had
2017 Sep 01
2
ganesha error ?
Hi, I got these errors 3 times since I'm testing gluster with nfs-ganesha. The clients are php apps and when this happen, clients got strange php session error. Below, the first error only happen once but other errors happen every time a clients try to create a new session file. To make php apps work again, I had to restart the client. Do you have an idea of what's happening here ?
2006 May 23
3
ez-where headscratch
Hi there, I''m puzzled by this apparently simple query I can''t manage to reassemble using ez_where plugin. cond = Caboose::EZ::Condition.new :my_table do start_on < Time.now any {end_on > Time.now; end_on.nil?} end I keep getting the following result : >> cond.to_sql => ["my_table.start_on < ? AND (my_table.end_on > ?)", Tue May 23
2009 Oct 01
1
Help me replace a for loop with an "apply" function
...if that is possible My task is to find the longest streak of continuous days a user participated in a game. Instead of writing an sql function, I chose to use the R's rle function, to get the longest streaks and then update my db table with the results. The (attached) dataframe is something like this: day user_id 2008/11/01 2001 2008/11/01 2002 2008/11/01 2003
2008 Nov 06
1
problem packaging S4 class that contains a slot of jobjRef class
Hello, I'm trying to package some source files that link R to a broker using a Java API and the rJava package. I am successful doing the connection and operate on it using my R code. I would like to package the files and release the package. I created some S4 classes to hold several Java objects. I use WinXP and R 2.7.1. I've searched RSeek and the Wiki for help, but could not find a
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to dump the DB, modify the table''s structure, then go and modify EVERY insert statement. The insert statements look like (from memory): INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''', ''some_other
2006 Dec 12
1
Hourly Time Series
I have hourly data for approximately 21 days in the following format DateID HourID Metrics 20060920 0 xxxxxx 20060920 1 xxxxxx The hour ids correspond to one hour windows starting 00:00 to 23:59. I have never dealt with TS data before. What is the best way to handle this data? TS objects or use the Zoo package? Thanks in advance.
2020 Feb 12
0
[FOR THE RECORD] CLIENTID Extension for IMAP/SMTP AUTH in dovecot
More and more email clients are now starting to support the CLIENTID extension for IMAP, including 'libetpan', SaneBox, BlueMail, and now as of Thunderbird 68.5.0, available there as well. This allows for a form of native two factor support, permission token, and/or access control to prevent the unauthorized use of email address and password. (For more information, please see the RFC
2009 Nov 06
1
issues with SSOAP when wsdl has ComplexTypes
I recently started trying R and SSOAP and was able to successfully try a "hello world" service. I am now trying to get a more complicated interface to work with SSOAP and so far failed miserably at that and so need any help I can get from here. The service I am attaching is a prototype for a full service that would take information to identify a data source and a query to run and return
2011 Sep 12
0
Migrate column from text to binary (PostgreSQL)
Hello, So I''ve realized one of the columns in a table has to be binary instead of text. However, a straightforward change_column :my_table, :my_column, :binary fails under PostgreSQL (9.x series) The error message being: PGError: ERROR: column "my_column" cannot be cast to type bytea : ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE bytea Now
2006 Jul 18
2
Scaffold a Plural table w/ No Pluralization in environment
Hi guys, I have a situation here. I have my project set to no pluralization due to legacy tables in environment.rb. Now, I have some new tables which I''m starting to pluralize. When I do a generate a scaffold to this new table: script/generate scaffold my_tables table it seems to work out fine for certain sections like http://mysite.com/railsapp/new (which also inserts properly to
2006 Apr 10
1
Add Column After Column in Migrations
Adding a column to a table just places the column at the end, but I like to keep related columns together. Is there a way to specify where the column is added in a table with migrations? For example, in MySQL you can do: ALTER TABLE my_table ADD COLUMN new_column INT AFTER other_column I was hoping migrations would support something like this: add_column :my_table, :new_column, :integer,
2018 Feb 15
3
[Bug 1226] New: Segmentation fault when printing a rule checking byte zero of NFT_PAYLOAD_LL_HEADER
https://bugzilla.netfilter.org/show_bug.cgi?id=1226 Bug ID: 1226 Summary: Segmentation fault when printing a rule checking byte zero of NFT_PAYLOAD_LL_HEADER Product: nftables Version: unspecified Hardware: x86_64 OS: Debian GNU/Linux Status: NEW Severity: normal Priority: P5
2019 Aug 30
0
NFS Server on Centos 7.6.1810 dying without reason
I managed to get NFS statistics just before server rebooted. I can reproduce this every time. Question: Am I saturating the SATA bus on the NFS server so violently with the SSDs that the server hard reboots? Perhaps due to the RAID 6 nature of operations? Server info AMD EPYC 7281 16CORE 32 GIG RAM 6xSATA3 SSD 1.9TB in mdadm RAID6 OS: Centos 7.6 SATA controller: Advanced Micro Devices, Inc.
2006 Nov 08
0
Fw: data frames re-ordering and naming columns
Thank you for help with the first part. The second part I do not understand. All I get is "3" "3". Presumably this is the factor that you refer to. Is there no simple way of extracting the text alone ----- Forwarded Message ---- From: Peter Alspach <PAlspach@hortresearch.co.nz> To: Jabez Wilson <jabezwuk@yahoo.co.uk> Sent: Tuesday, 7 November, 2006 7:46:02 PM
2007 Mar 16
0
find() and SQL functions
Hi, I have a complex SQL request to perform. I don''t want to manually do the whole query (find_by_sql) because of the complex joins, but I want to use MySQL functions, such as: Model.find(:all, :include => [../..], :conditions => ["(../..) AND YEAR(STR_TO_DATE(my_table.my_row,''%Y-%m-%d %H:%i:%s'')) = #{year})"], :select
2011 Jan 21
3
data and parameters
(1) I have a master data frame that reads ClientID |date |value (2) I also have a control data frame that reads Client ID| Min date| Max date| control parameters The control data set may not have all client IDs . I want to use the control data frame on the master data frame to remove client IDS that don't exist in the control data set and for those that do, remove dates outside the