Error in rails 1.2.3 activerecord

i’m a rails nuby so i don’t know where to fix this in the activerecord
module…

there is no such column in the sys.view.user_constraints.
SELECT uc.index_name FROM user_constraints uc WHERE uc.constraint_type =
‘P’

this prevents me from doing a rake test:functionals …as in below…

C:\railsspace>c:\ruby186\ruby\bin\ruby c:\ruby186\ruby\bin\rake
test:functionals --trace
(in C:/railsspace)
** Invoke test:functionals (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:test:prepare
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:clone
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
rake aborted!
./db/schema.rb:9: syntax error, unexpected tIDENTIFIER, expecting kDO or
‘{’ or
‘(’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/de
pendencies.rb:488:in load' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/de pendencies.rb:488:inload’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/de
pendencies.rb:342:in new_constants_in' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/de pendencies.rb:488:inload’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:31
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
call' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
each' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:insynchroniz
e’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:76 c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:incall’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
execute' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:ineach’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
execute' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:ininvoke’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
synchroniz e' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:ininvoke’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:153
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
call' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:in
each' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:399:inexecute’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:369:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:insynchroniz
e’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:376:ininvoke_pre
requisites’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in
each' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:insend’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1021:in
each' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:375:ininvoke_pre
requisites’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:368:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:insynchroniz
e’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:362:in
invoke' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:inrun’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:in
each' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/lib/rake.rb:1935:inrun’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7
c:/ruby186/ruby/bin/rake:16:in `load’
c:/ruby186/ruby/bin/rake:16

This file is autogenerated. Instead of editing this file, please use

the

migrations feature of ActiveRecord to incrementally modify your

database, and

then regenerate this schema definition.

ActiveRecord::Schema.define(:version => 2) do

Could not dump table “users” because of following

ActiveRecord::StatementInvalid

OCIError: ORA-00904: invalid column name: SELECT

lower(i.index_name) as index_name, i.uniqueness, lower(c.column_name) as
column_name
FROM user_indexes i, user_ind_columns c
WHERE i.table_name = ‘USERS’
AND c.index_name = i.index_name
AND i.index_name NOT IN (SELECT uc.index_name FROM
user_constraints uc WHERE uc.constraint_type = ‘P’)
ORDER BY i.index_name, c.column_position

end

Dave R. adds: i’m using oracle 8i

On Fri, 24 Aug 2007, Dave R. wrote:

i’m a rails nuby so i don’t know where to fix this in the activerecord
module…

there is no such column in the sys.view.user_constraints.
SELECT uc.index_name FROM user_constraints uc WHERE uc.constraint_type =
‘P’

It would help to see the source from which the tables are constructed
(SQL, migrations,…)

this prevents me from doing a rake test:functionals …as in below…

C:\railsspace>c:\ruby186\ruby\bin\ruby c:\ruby186\ruby\bin\rake
test:functionals --trace
(in C:/railsspace)
** Invoke test:functionals (first_time)
[…]
** Execute db:schema:load
rake aborted!
./db/schema.rb:9: syntax error, unexpected tIDENTIFIER, expecting kDO or
‘{’ or
‘(’
c:/ruby186/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/de
[…in rake…]
run' c:/ruby186/ruby/lib/ruby/gems/1.8/gems/rake-0.7.2/bin/rake:7 c:/ruby186/ruby/bin/rake:16:inload’
c:/ruby186/ruby/bin/rake:16

So this is your schema.rb??

OCIError: ORA-00904: invalid column name: SELECT

This is Oracle? I’m unfamiliar with that.

lower(i.index_name) as index_name, i.uniqueness, lower(c.column_name) as
column_name
FROM user_indexes i, user_ind_columns c
WHERE i.table_name = ‘USERS’
AND c.index_name = i.index_name
AND i.index_name NOT IN (SELECT uc.index_name FROM
user_constraints uc WHERE uc.constraint_type = ‘P’)
ORDER BY i.index_name, c.column_position

end

It’s hard (for me) to tell where this is coming from without a bit more
info on how your tables are declared.

    Hugh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs