Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql select to read iseries file

Author  Topic 

Daninpa
Starting Member

13 Posts

Posted - 2009-07-17 : 15:27:32
Hi,
I'm trying to use an sql server 2005 select command to read the first 500 records of an iseries file but cant figure out the correct syntax. I tried this:

Select top 500 *
From Smpxxlib.Xxxcp50P

but I cant use the Top keyword on an iseries file. Can anyone give me an example of using the select statement to read the first 500 records of an iseries file?

Thanks in advance!

Skorch
Constraint Violating Yak Guru

300 Posts

Posted - 2009-07-17 : 18:37:11
I'm not sure what an iseries file is, but does it let you do this:

SELECT * FROM Smpxxlib.Xxxcp50P

If so, you can probably do this:

SELECT TOP 500 *
FROM (SELECT * FROM Smpxxlib.Xxxcp50P)

Some days you're the dog, and some days you're the fire hydrant.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-17 : 21:21:18
Select * From Smpxxlib.Xxxcp50P FETCH FIRST 500 ROWS ONLY
Go to Top of Page

Daninpa
Starting Member

13 Posts

Posted - 2009-07-20 : 08:49:23
Thanks for both responses. Unfortunately I tried both and both give an error. When I tried Skorch's, it says theres an error in the expression next to "500" and when I tried russell's, it says theres an error in the expression next to "First". I'll keep trying and thanks again for the suggestions!
Go to Top of Page
   

- Advertisement -