SELECT TOP 10 * FROM person
-- returns 10 rows
SET ROWCOUNT = 5;
SELECT TOP 10 * FROM person;
-- returns 5 rows
SET ROWCOUNT = 12;
SELECT TOP 10 * FROM person ORDER BY id;
-- returns the first 10 rows of the full list ordered by column id.
Basically it lists all of the weapons in the dat file. It displays 20 items per page.
This gives a pretty big load time for my larger dat files and instead of selecting ALL items i would like to select only the ones needed for each page.
The data displayed is BASICALLY the data I can use... So there is no other choice but to find a way to get the rownumbers.
Actually, if "Name" is unique, you could use that. Something like:
select top 20 * from table order by name
then get the that 20th name and use it in the next query:
select top 20 * from table where name > '20th name' order by name
Are the displayed fields the only ones that are defined in the DDFs? Can you post the CREATE TABLE / CREATE INDEX statements for the table?
After putting this into play I'm still going to run into issues.
Basically now I will need to run 3 queries instead of 1
One to find the top number
One to find the 20 records in the page data
One to find the total values in the table
Also when I am running the first query to find the top number, when I get into the larger page numbers I'm basically looking doing a query on all those numbers anyways..
For Example
$page = 40
select top ($page-1)*20 Name from table
will select the top 780 records
So unfortunately it WORKS but there is still going to be an issue here..
The old way I have it works.. But unfortunately I do tend to get unwanted server lag when people initially load the page :/
I would rather not if i can avoid it... Think there are any plans to change PSQLs limit function into one more similar to MySQLs in newer versions of Pervasive?
I don't know if Pervasive is planning to add it. Do you know if it works in MS SQL? That seems to be what PSQL is compared to in terms of functionality.
I would also suggest contacting Pervasive directly and telling them it would be be a good enhancement. Be prepared to give a business case for it.
My Comment:
Would be nice to have a variable in PSQL that returns the current row number or a function such as mysql's 'limit' function that selects a range of rows. ie select * from table limit 10, 20 ... basically that would select 20 records AFTER the first 10 OR select * from table where ROWNUMBER > 10 AND ROWNUMBER < 30 ... this would do the same thing. Personally I think this is a very important feature to people with high content tables that Pervasive currently does not have (that I can find)
Response from Pervasive:
Dear #######,
Thank you for your request for support today.
In order to provide complimentary support, we will need the Pervasive part number and serial located on the software box, license agreement, or registration card. Then will need for you to provide a copy of an invoice dated within the last 60 days. Please fax it to 512.231.6299 or e-mail it to customersupport@pervasive.com.
Once we receive this information, we will process your request immediately.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.