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 8398363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:02:19+00:00 2026-06-09T21:02:19+00:00

I am trying to create a complex view that will be accessed via a

  • 0

I am trying to create a complex view that will be accessed via a linked server in a MS-SQL server. The problem I am having is that the query uses ROWNUM to generate a ROWID.

The generated ROWID has a datatype of NUMBER but this is apparently causing me a problem and if I can get this into a NUMBER(insert size here) It will all be fine. but I am unsure if this is even possible.

CREATE OR REPLACE FORCE VIEW EXAMPLE ("ROW_ID")
AS
SELECT ROWNUM ROW_ID,
FROM
(SUB-QUERY)

I am unable to give the full query and column names (work constraints) but here are the returned column types from the query in SQL Developer

column types

I think the problem is centred around the returned datatype of ROWNUM being Number and not NUMBER(20) or similar length and that this cross-over is the problem I am seeing with regards to the linked server error but if anyone knows different let me know 😉

  • 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-06-09T21:02:21+00:00Added an answer on June 9, 2026 at 9:02 pm

    you can use the cast function: cast( rownum AS NUMBER(10)) as row_id

    create or replace view tvv as 
       select cast( rownum AS NUMBER(10)) as row_id 
       from all_objects 
       where rownum < 10;
    
    > desc tvv
     Name              Null?    Typ
     ----------------- -------- ------------
     ROW_ID                     NUMBER(10)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a view out of quite a complex select query and
I'm trying to create a complex SQL query (at least for me) but really
I'm trying to create a complex custom NSControl that must be able to send
I'm trying to create a somewhat complex sorting feature which neither uses divs nor
I'm have a fair complex Form that I am trying to create in Play
I'm trying to create a moderately complex query with joins: SELECT `history`.`id`, `parts`.`type_id`, `serialized_parts`.`serial`,
I am trying to create a somewhat complex relationship in Rails, and am having
I'm trying to create a complex view using Drupal 7.8, Views 7.x-3.0-rc1, and References
I'm trying to use the Entity Framework to create a complex query and get
I'm trying to create a semi-complex set of view animations (think an animated version

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.