Re: SET ROWCOUNT
Posted in 1997
Topics: Stored Procedures & SPL, Server Administration
Roger Tomas wrote:
>
> Sujit Pal wrote:
> >
> > Lately there has been some postings advising to SET ROWCOUNT n to get =
> > the first n rows of a query, for example:
> >
> > SET ROWCOUNT 3;
> > SELECT * FROM employee ORDER BY salary DESC;> >
> > will return the top 3 earners in the database.
> >
> > I have been trying it on my databases here but it bombs out at ROWCOUNT =
> > with a 201: Syntax Error has occured. I have 7.14.UD1 and 7.20.UC2 here =
> > and they are both giving me errors. What version of dbaccess / isql is =
> > this supported?
>
> I believe the original post was cross-posted to both the Informix
> and Sybase newsgroups. Perhaps the SET ROWCOUNT statement belongs
> to Sybase?
>
> -----------
> Roger Tomas
> AG Communication Systems
So, what's the solution? I wish I could declare a cursor in
a stored procedure and fetch 50 times. However, since the
table names are not known until run time, I can't use the
stored procedures. However, I was thinking of creating a
temporary table in which I save 50 rows which qualify the
WHERE clause from all the tables. But I am not sure how to
restrict the rows to 50 only!
Jamwal
Email: jamwal@quality.com