Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6581529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:09:52+00:00 2026-05-25T16:09:52+00:00

I have a simple model which I have to set the database name manually

  • 0

I have a simple model which I have to set the database name manually on.

Also since it is using an oracle database, I’m setting the sequence name so I can have auto incrementing id’s.

When I run the rails console and try to create my model, it comes back and says that the sequence cannot be found. The weird part is the sequence it cannot find is not the sequence that I set in set_sequence_name.

Model

class Survey < ActiveRecord::Base
  set_sequence_name "SURVEY.SQ_SURVEY_ID"
  set_table_name "SURVEY.SURVEYS"
end

Console error

ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: ORA-02289: 
sequence does not exist: select SURVEY.SURVEYS_seq.nextval id from dual

It looks like its ignoring my set sequence name line.

Am I just missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:09:52+00:00Added an answer on May 25, 2026 at 4:09 pm

    Clarifying, this works for oracle 10g

    So as far as I can tell, this is a bug in the jdbc adapter (see here http://kenai.com/jira/browse/ACTIVERECORD_JDBC-133). For a work around I’m setting the id manually with a before create filter like this:

    class Survey < ActiveRecord::Base
      set_table_name "SURVEY.SURVEYS"
    
      before_create do
        #since we can't use the normal set sequence name we have to set the primary key manually
        #so the execute command return an array of hashes,
        #so we grab the first one and get the nextval column from it and set it on id
        self.id = ActiveRecord::Base.connection.execute("select SURVEY.SQ_SURVEY_ID.nextval id from dual")[0]["id"]
      end
    
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple model which looks like this: class Group(models.Model): name = models.CharField(max_length
I have a model which contains many predefined rows (> 100) and also can
I have a simple model class (Part), which pulls from it's information from a
I have a simple model like this one: class Artist(models.Model): surname = models.CharField(max_length=200) name
I have a simple data model of two tables, email and recipients, email can
I have a simple Poco-Model using abstract classes, and it seems not to work
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I have a simple modal form which I'd like to close when Esc is
I have a simple model called Party with a corresponding table called parties .
We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.