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

  • SEARCH
  • Home
  • 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 6251239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:34:41+00:00 2026-05-24T13:34:41+00:00

I am developing a RoR project using an Oracle database. Recently I added a

  • 0

I am developing a RoR project using an Oracle database. Recently I added a DBLink to another database and this works perfectly just from an SQL.
When I want to add the table to my class with the following code…

class ServerModel < ActiveRecord::Base 
  set_table_name "S985.S985_947_MODELS_VW@R985_A947.WORLD"
  set_primary_key "model_barcode"

  acts_as_reportable
  acts_as_entity
end

… I get this error:

NativeException: java.sql.SQLException: ORA-02084: database name is missing a component
: select * from (SELECT "S985"."S985_947_MODELS_VW"@"R985_A947"."WORLD".* FROM "S985"."S985_947_MODELS_VW"@"R985_A947"."WORLD"  ) where rownum <= 14

Of course this automatically used query does not work. It shouldn’t select "S985"."S985_947_MODELS_VW"@"R985_A947"."WORLD".* but just "S985"."S985_947_MODELS_VW".*, without duplicating the name of the dblink (@R985_947.WORLD).

Is this possible with the set_table_name method or any other ActiveRecord method?

The answer looks simple, but I cannot find the solution. Can anybody help me with this problem?

Thanks!

  • 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-24T13:34:42+00:00Added an answer on May 24, 2026 at 1:34 pm

    Unsure about tweaking Active Record to include the DB Link name, but what about creating a view of the remote table, something like:

    create or replace view S985_947_MODELS_VW
    as
    select * from S985_947_MODELS_VW"@"R985_A947"."WORLD"
    

    And then just accessing the view in the ROR application? Not sure if the view can be inserted, updated etc – you would need to check that out. I have a feeling a ‘simple’ view (ie one on a single table without group by etc) can be updated and inserted into.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing RoR application that works with legacy database and uses ActiveScaffold plugin
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
Developing a website and just trying to get back into the swing of (clever)
When developing (works fine live) the pages for our website don't pick up the
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
Developing a .NET WinForms application: how can I check if the window is in
Developing server side code i finally got my eyes X-crossed trying to write -
When developing a desktop application in .NET, is it possible to not require the
When developing whether its Web or Desktop at which point should a developer switch
When developing a new web based application which version of html should you aim

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.