Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here




Hi, Oracle has a function that allows one to sample a large table. can I do sampling in Informix? Thanks a lot!

RE: sampling


Sorry, but you're going to have to explain what sampling is.



RE: sampling

Some tables are huge. Instead of pulling out the whole table, you randomly select 2% of the total rows? One way you can do it in Oracle is using 'sample (2)' after from statement.

While we are at it, is there also a feature in Informix that is similar to 'where rownum<n' in Oracle?

I have checked online documents and personal referrence, it was not there. Thanks

RE: sampling


I don't know much about Oracle.  Thanks for the update. The closest thing I can think of using FIRST. Beginning with Online 7, Informix provides a FIRST keyword. So if you wanted to the first 10 rows, it's

SELECT FIRST 10 col1, col2 FROM table_name WHERE ....

For the Informix 4GL programmers, in order to use FIRST, declare the select as a cursor.

Informix also has a rowid.  It's a guaranteed unique integer value and does not change for the life of the row.  So you can do:

SELECT * FROM table_name WHERE rowid = 45678

If you're using fragmented tables, rowid works a little different.  I've really not had fragment tables, but I think you have to delcare the rowid column.



RE: sampling

Thanks, Ed. That is helpful!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close