Link to home
Create AccountLog in
Crystal Reports

Crystal Reports

--

Questions

--

Followers

Top Experts

Avatar of WEhalt
WEhalt🇺🇸

Sybase - Limit Size and/or Record Count of Temp Table
I am using a Sybase Database that keeps running out of temp db space.  I am looking for code that will limit the size or record count of a temp table created.  We have reports that can blow up our server if the requestor asks for too much information.  We can limit date parameters easily, but some of our reports have 20+ parameters and there is no easy way to limit the output with conventional error checking.


The reports are built in Crystal Reports.  If there is not a command in Sybase perhaps there is something in Crystal.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of vastovasto🇺🇸

If this is for testing purposes you can use menu View -> Preview Sample to run the reports
However I doubt this will reduce the size of the temp table because it will be created during the query process not the data transport

Avatar of WEhaltWEhalt🇺🇸

ASKER

Yes - that is correct.  I need a way to make the report stop if it reaches a certain 'critical mass' basically.  Another avenue could be to limit the amount of time the query that fills the temp table is given to run.

Avatar of vastovasto🇺🇸

If you use Preview Sample this will be like creating a tempo table and retrieving top N records. The temp table will always contain all the data but you will download just TOP N records from  this data. I would still try it but there is a good chance that this will not resolve your problem. Did you think about adding an optional parameter "Test" which you will set when you are running the report in test mode and will limit the number of the records ?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of WEhaltWEhalt🇺🇸

ASKER

The commands that are running these Crystal reports from Sybase have numerous temp tables because the requests are complex.  I can't simpy add a 'top' to it and solve the problem.  Even if I did add a 'test' parameter the report requestors that use a report portal would simply not use it.  This is a report that is used by many requestors and is designed to be versatile.  Unfortunately, if the requestor enters a combination of the 20+ paramaters that would return a very large dataset it blows up the server.


I need a way to make data stop building when it reaches a certain size or it runs for a particular amount of time or a certain amount of records is reached.

Avatar of vastovasto🇺🇸

WEhalt, you cannot return part of the data because there is no space on the server. This will make the reports wrong. Just imagine if somebody wants to see the sales for the month and the report shows 10% of the actual sales because there is no space. This might lead to wrong decissions. If you cannot add more space then you should restrict the user to run big reports not to restrivct the returned data

Avatar of WEhaltWEhalt🇺🇸

ASKER

I want like the report to fail, not run partially.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


I think the only way to have the report fail would be to have Sybase delete the temp tables if it runs out of space and return an empty table.

You would have to somehow have the report distinguish between NO DATA for the criteria and TOO MUCH DATA for the criteria

mlmcc

Avatar of WEhaltWEhalt🇺🇸

ASKER

Please forget that this runs in Crystal.  I truly don't believe Crystal holds the key, I just added it because I didn't want to leave it out in case there was some way to use it.

If I was running a command in Sybase, is there a way to tell the command to stop running or to tell a query to stop running if it reacheas a certain size and or a record count?

For example, could I allocate (ALLOC) a defined about of space for temp table or for the entire process?

ASKER CERTIFIED SOLUTION
Avatar of alpmoonalpmoon🇦🇺

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
Crystal Reports

Crystal Reports

--

Questions

--

Followers

Top Experts

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.