Displaying 20 results from an estimated 33 matches for "select_one".
2005 Dec 21
7
use of SET command in find_by_sql
Hi,
I''m trying to execute something like this method in a model:
def self.sql_for_rankings()
sql = "SET @counter:=0;"
sql << " SET @counter:=0;
SELECT *, @counter:=@counter+1 AS rank
FROM testscores. "
find_by_sql(sql)
end
Where the new rank column is a kind of autoincrementer inside of
2006 Feb 25
5
MySQL client ran out of memory
...pters/mysql_adapter.rb:180:in
`execute''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:322:in
`select''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:in
`select_one''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
`select_value''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in
`count_by_sql''
/usr/local/lib/ruby/gems...
2001 Mar 30
1
ntdll error msg
Hello,
I'm a newbie to wine. I've installed
codeweavers-wine-20010305-1.i386.rpm to Redhat Linux 6.2; Windows
version is win98.
I've tested the wine install and can run sol.exe, micrsoft office apps,
and a Pegasus Email client just fine.
The main purpose of installing wine is to run an EDI windows client
server application - Gentran Server 5.2.1.04. I need the Gentran
client
2010 Dec 14
4
Change primary_key column name
Hi,
after changing a primary key column name, the auto-increment information
(MySQL) and sequence (Oracle) are lost. What is the correct way to rename
primary keys?
Thanks,
Gustavo
--
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
2006 Apr 20
1
has_many.count not accepting options hash
...85:in `execute''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor
d/connection_adapters/mysql_adapter.rb:337:in `select''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor
d/connection_adapters/mysql_adapter.rb:180:in `select_one''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor
d/connection_adapters/abstract/database_statements.rb:16:in `select_value''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor
d/calculations.rb:161:in `execute_simple_...
2006 Jan 15
0
OS X Rails - Nuby
...onfig/..
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:325:in
`select''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:in
`select_one''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
`select_value''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in
`count_by_sql''
/usr/lib/ruby/gems/1.8/gems/active...
2006 Apr 08
4
Calling validates_inclusion_of out of default namespace
...inclusion_of", but I can''t seem to find
the logic in it. So, how do I call it?
This question could be generalised, because I never know what to call when
something is not in de default namespace. For example, how do I know that
"ActiveRecord::ConnectionAdapters::SQLServerAdapter.select_one" can be run by
"ActiveRecord::Base.connection.select_one"? I happen to know this one, but I
would have never guessed...
Thanks in advance.
2006 May 06
7
New Ajax and Rails tutorial
Hi,
I just published the first version of a small tutorial I''ve written on
Ajax and Rails. It is called "How to paginate, sort and search a table
with Ajax and Rails" (sorry, I didn''t manage to find a longer title !)
and is available at :
http://dev.nozav.org/rails_ajax_table.html
There is nothing really new in it, it''s rather a compilation and
2007 Oct 08
1
Rails reverses apostrophes
Hi,
I am quite new to Ruby on Rails so this might have a very simple
answer... My problem gives the following error message when I try to
call the count function for an item.
Mysql::Error: Unknown column ''TournamentTemplate'' in ''where clause'':
SELECT count(*) AS count_all FROM action_logs WHERE
(action_logs.loggable_id = 1 AND action_logs.loggable_type =
2006 Jan 15
2
Please help - Rails hanging on mysql connection
.../config/..
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:325:in
`select''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:in
`select_one''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
`select_value''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in
`count_by_sql''
/usr/lib/ruby/gems/1.8/gems/activere...
2006 Mar 10
7
ODBC adapter connection help please.
Does anyone have any experience getting ODBC to work? I could really use
some help here.
I''m having trouble accessing a db2 database via odbc using rails. It''s an
external database, that I import data from. I have placed the connection
code in my model :
unless connected?
establish_connection(
:adapter => "odbc",
:dsn => "<dsn
2018 Jan 03
3
HOW TO FILTER DATA
Hello,
I have a data of Patents from OECD in delimited text format with IPC being
one column, I want to filter the data by selecting only certain IPC in that
column and delete other rows which do not have my required IPCs. Please,
can anybody guide me doing it, also the IPC codes are string variables.
The data is somewhat like below, but its a huge dataset containing more
than 11 million rows
2007 Jan 18
4
Defining the expected behavior of DatabaseStatements.execute()
It would be very helpful if the core team could define and document
the expected behavior of DatabaseStatements.execute(). The
implementations appear to vary. Most adapters will return some sort of
native result set, SQL Server returns nil and expects a block, DB2 and
Sybase return the affected row count.
So please, will someone in core explain the expected behavior and can
the execute()
2006 Apr 03
4
How to fake composite primary keys?
I know ActiveRecord doesn''t support composite primary keys, but I need to use
one, and I need it ASAP. I don''t need any composite foreign keys, luckily;
what I have is a table that stores old versions of rows in another table, so
the composite key is an id + date stamp. Would someone tell me a hack I can
use to support this?
--
View this message in context:
2005 Oct 17
8
Using active record for SELECT MAX(column) FROM ...
Hi,
Is there an easy way of querying an active record for a maximum column
value? I need to do queries like:
SELECT MAX(salary) FROM employees
TIA,
Jeroen
2006 Feb 15
0
MySql adapter error
...on_adapters/mysql_adapter.rb:180:in
`execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:322:in
`select''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:in
`select_one''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
`select_value''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in
`count_by_sql''
c:/ruby/lib/ruby/gems/1.8/gems...
2006 Feb 21
0
Rails edge breaks my app
...on_adapters/mysql_adapter.rb:180:in
`execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:322:in
`select''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:175:in
`select_one''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in
`select_value''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:518:in
`count_by_sql''
c:/ruby/lib/ruby/gems/1.8/gems...
2001 Mar 09
0
Diablo and wine-20010305
Hi!
I've tried to play Diablo (1) under wine. Setup worked, X switches to
640x480 and the title screen appears, but then all I get is a black
screen.
Output from wine:
---
mahowi@marvin:~ > esddsp wine /opt/wine/Program\ Files/Diablo/diablo.exe
FIXME:pthread_rwlock_rdlock
FIXME:pthread_rwlock_unlock
Could not stat /misc/floppy (No such file or directory), ignoring drive A:
2006 Aug 02
1
Ad-hoc database queries from models
...lserver'', ''username'', ''password'')
=> #<DBI::DatabaseHandle:0xb750bf58 @trace_mode=2,
@handle=#<DBI::DBD::ODBC::Database:0xb750bea4 @attr={},
@handle=#<ODBC::Database:0xb750becc>>, @trace_output=#<IO:0xb7d35fec>>
>> conn.select_one(''SELECT Subject FROM CASE WHERE CaseId = 12345678;'')
=> ["Test Case"]
>> conn.disconnect
Assuming this is the best way to achieve this (unless there''s good
reason to do so I don''t want to create models as the SQL code above is
greatly simpli...
2005 Apr 26
0
NoMethodError (undefined method `fetch_fields' for nil:NilClass)
...thod `fetch_fields'' for nil:NilClass):
/usr/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/
active_record/connection_adapters/mysql_adapter.rb:204:in `select''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/
active_record/connection_adapters/mysql_adapter.rb:98:in `select_one''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/
active_record/base.rb:452:in `count_by_sql''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/
active_record/base.rb:445:in `count''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/
action_controlle...