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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:17:06+00:00 2026-06-16T15:17:06+00:00

I have an application in C# that uses an Oracle database. I need a

  • 0

I have an application in C# that uses an Oracle database.
I need a query to fetch the unlocked row from a table in oracle database.
How can I select all unlocked rows?

Is there any ‘translator’ out there that can translate this T-SQL (MS SQL Server) query to Oracle dialect?

SELECT TOP 1 * FROM TableXY WITH(UPDLOCK, READPAST);

I’m a little bit disappointed with Oracle lacking such a feature. They want to make me use AQ or what?

  • 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-16T15:17:07+00:00Added an answer on June 16, 2026 at 3:17 pm

    Oracle does have this feature, specifically the SKIP LOCKED portion of the SELECT statement. To quote:

    SKIP LOCKED is an alternative way to handle a contending transaction
    that is locking some rows of interest. Specify SKIP LOCKED to instruct
    the database to attempt to lock the rows specified by the WHERE clause
    and to skip any rows that are found to be already locked by another
    transaction.

    The documentation goes on to say it’s designed for use in multi-consumer queues but this does not mean that you have to use it in this environment. Though the documentation says this there is a large caveat. You can’t ask for the next N unlocked rows – only the next N rows, of which the unlocked ones will be returned.

    SELECT * 
      FROM TableXY 
     WHERE ROWNUM = 1
       FOR UPDATE SKIP LOCKED
    

    Note that if the table you’re selecting from is locked in exclusive mode, i.e. you’ve already instructed the database not to let any other session lock the table you will not get any rows returned until the exclusive lock is released.

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

Sidebar

Related Questions

We have an WCF application which uses NHibernate to query data from the database.
We have an application that uses Hibernate's 2nd level caching to avoid database hits.
i have an application that uses SMTP to send emails from an yahoo account.
I have an application that uses the Oracle MERGE INTO... DML statement to update
I have a web application based on Java/Spring that uses Oracle 11g. Currently, the
I have a Java JDBC application that uses multiple threads to retrieve information from
We have an asp.net web application that uses nHibernate with our Oracle backend DB.
I have a legacy Struts 1.2.8 application that I'm maintaining and porting from Oracle
I have an application that uses a ResourceDictionary to set the styles, which it
I have an application that uses Hibernate. It generated the following SQL statement. I

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.