Displaying 20 results from an estimated 3000 matches similar to: "Migration and Mysql row ID"
2006 Jun 09
3
sqlSave() and rownames=TRUE makes my Rgui crash
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect to this table:
library(DBI)
library(RODBC)
chan <- odbcConnect("MySQL51", uid="root", pwd="xxx")
first <- sqlQuery(chan, "select * from example")
2006 Jun 26
8
id of last element in a table
Hi,
I would like to figure out how to determine what the id of the last
element in a table is. Is there an equivalent to the Table.find() method
which will tell me the number of elements in a table? also, maybe more
importantly, where are the available methods on tables documented?
What i am trying to do is to increment the id and work through a table
and check whether the id i am currently
2007 Jun 26
2
how to iterate
for the following example dataset:-
Category Variable 1 127 1 261 1 142 1 183 1 234 1 162 2 173 2 321 2 168 2
197 2 213 2 261 3 198 3 126 3 167 3 154 3 134 3 187 3 109 3 210
I have performed Anova on the measured variable (column#2) for the groups
1,2&3 (column#1). Now I want to randomize the values in C#2 and reperform
the test, say, a hundred times. Please suggest a way for this
2006 Feb 23
3
has_many reference
I am trying to do something right from Agile Web Dev with Rails book
and it does not work. I must be missing something obvious.
I have a one-to-many relationship:
class Draft < ActiveRecord::Base
has_many :endorsees
end
class Endorsees < ActiveRecord:: Base
belongs_to :draft
end
>From my reading, methinks I should be able to say:
d = Draft.new
d.endorsees << Endorsee.new
2006 May 13
1
Rake clone bug?
Hi. I''m having a problem with my testing. The following table in my
development database (MySQL 4.1.12, InnoDB):
+-----------------------+------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+-----------------------+------------------------+------+-----+---------+----------------+
|
2011 Jun 15
12
Create or Update Model with JSON?
Having issue updating a model with JSON. I simply *"model.attributes=json"*,
which does update the attributes but not the id, or uuid in this case. I
want to save or create the record (if it''s id exists). Seems like this would
be documented, but I''m not finding anything. I''m using a MOM to pass JSON
between apps. Thanks.
--
You received this message because
2006 Jan 11
3
How do you do a custom sql call in rails?
Hi.
I am developing an industry specific crm that allows busineses to track
customers in a particular way. Each customer will be assigned a customer
number. The first customer will have a customer number of 1, the second
customer_number = 2, etc... Note that this customer number is not global
but particular to the account that created the customer (see schema snip
below).
I need to have a
2009 Jul 28
4
How to do poisson distribution test like this?
Dear R-listers,
I want to reperfrom a poisson distribution test that presented in a
recent-published biological research paper (Plant Physiology 2008, vol 148,
pp. 1189-1200). That test is about the occurrence number of a kind of gene
in separate chromosomes.
For instance:
The observed gene number in chromosome A is 36.
The expected gene number in chromosome A is 30.
Then, the authors got a
2006 May 25
5
CSS Effects? (javascript?)
Is there a way to assign a CSS style to an element I am not currently
interacting with? For instance, if I have two TD elements of a table. I
click on one of them, and I want to have a style change in the other
element. Is this possible?
I''m guessing script.aculo.us might be able to help me.... but
considering how nothing on their site is loading for me right now I have
no way of
2005 Mar 07
3
exclude an attribute from save
Hi,
I''ve used .save to save the attributes, but on my table there is an
autoincrementing id (not the primary key) that doesn''t need to be
inserted... but save try to INSERT it anyway... is there a way to
avoid save from acting this way or to whisper him to be more polite
this time? ;)
Thanks,
Enrico
--
"The only thing necessary for the triumph of evil
is for good men to do
2005 Jun 29
3
trouble with active record and sqlite
I am getting an error that I can''t figure out. I have a class called
Test with 3 fields, id, x, and y. When I do Test.new(''x''=>1,
''y''=>2).save, I get an error saying that id (my ''not null primary
key'') can''t be null. But isn''t active record supposed to deal with
setting that for me? Here''s the code
2006 Mar 01
7
Oracle Sequence & Rails
the compiler tell me it:
invalid column name: INSERT INTO ago.prova_stats (cognome, nome, id,
telefono) VALUES(''Medda'', ''Ivan'', :id, 70565611)
where ago.prova_stats is the table used by me and that have only the
columns ''cognome'',''nome'' and ''telefono''.
My table hasn''t the column
2006 Jul 21
2
Migration Date Format
Just wandering if anyone can tell me how to format date when writing
test data to upload to the db via a migration.
ie, to match the date migration column format
thanks
--
Posted via http://www.ruby-forum.com/.
2006 Feb 17
7
Create and then show
I am attempting to redirect to the show method after creating a new
object. So, for example, once a new post is created the user is
presented with the new post in a show view. The problem is I can''t get
the correct <at> post.id to send to the show method. Rails always
returns 0 for this value.
Here''s what I have so far:
class ContentController < ApplicationController
2006 Jul 31
9
Problems with ever-increasing ID value
I have a script that I am using to populate a database from a CSV file:
RAILS_ENV = ''development''
require File.dirname(__FILE__) + ''/../../config/environment''
require ''csv''
# Destroy existing data
Residence.destroy_all
# IMPORT DATA FROM apartments.csv
db_file = "#{RAILS_ROOT}/db/apartments.csv"
CSV.open(db_file, "r",
2011 Nov 21
3
[LLVMdev] Optimization of array access
I've attached a 2 examples of patterns for updating an array. They're simplified examples of some code generation I'm doing where I need to pass a large, unknown number of arguments (ints, doubles, pointers to other information) to a function.
The two patterns are:
Stack[0] = 0;
Stack[1] = 1;
Stack[2] = 42;
And
Int I = 0;
2008 May 22
4
how to find out autoincrement id ?
Hi
I need to push newly created item id to file. (ie. its autoincrement
value)
I tried this on controller but it wont work, it cant find id value for
the newly created item.
def create
@imitem = Imitem.new(params[:imitem])
system "echo \"@imitem.id\" > /tmp/myid"
any help ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2005 Dec 26
3
data insertion in multiple tables
I have two tables like:
Table A:
id (autoincrement)
name
Table B
id
id_of_A
desc
I want to add a record to table A and based on the id of A, I want to add a
record to table B.
I don''t think there is any SQL command that support this (at least in MySQL
4.1, so I use LAST_INSERT_ID()).
(Is there any other way? or MySQL 5 support any special SQL command?)
But I need
2007 Sep 11
3
ActiveRecord, blocking or async, logging, syslog/udp
Here''s a gedanken experiment for those w/ far more knowledge than I about
ActiveRecord, etc.:
Let''s say my database is very remote and on a very slow machine. Let''s
further say that my app has an action that leads to a very simple insert
into the "impressions" table of the db, a la "INSERT INTO impressions(docid)
VALUES($docid);" - and
2009 Sep 07
11
autoincrement for non-id column
There is a table:
execute (<<-SQL)
CREATE TABLE "tasks" (
"id" serial primary key,
"number" serial,
"version" integer DEFAULT 0 NOT NULL,
"latest_version" boolean DEFAULT ''t'' NOT NULL,
"hidden" boolean DEFAULT ''f'' NOT NULL,
"type" character varying (1) NOT