Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu reports with Sybase database

Status
Not open for further replies.

dm21

Programmer
Feb 6, 2003
74
0
0
CA
Hi,

I am using Impromptu 7.1 version with Sybase database.

I have created a few macros where I call Impromptu stored procedure report which saves data in physical table with unique id of database user id and report id. And finally creating simple list report going against the physical table and retriving data based on user id and report id.

I am having problem of uniqueness if sames report is run at the same time by same user with different parameters.

What can I use to make it unique.

Please if any body has faced this problem, can help me.

Thanks.
 
How is it possible for one user to start two reports simultaneously with different parameters?
If you're storing the time down to the second, this should not be a problem.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
When I say same time it means it could also have difference of 1 minute.

For eg. process 1 starts and trying to save data in table
and process 2 starts and it will try and delete data based on user id and report id from the table and will save data based on 2nd request.

In result the out put of 1st and 2nd is same. Even if I save data down to seconds, how can I filter that in Impromptu?
 
Create an integer field that stores the date/time down to the millisecond. Much the way DB2 does. That will be a unique field as the chances of two requests processing within the same millisecond in nil. You can then filter on that field also.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
How can I filter that in Impromptu report? Currently I am using user() function to filter data in Impromptu. I do not want to use prompt as it will not look good.
 
I don't think I'm fully understanding your requirement.
1.Are you asking how you need to store your data to make it unique?
OR
2. Are you asking how to filter your data so you only return one record for the user running the report?

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Hi DoubleD,

I am asking both the scenario, first to save it unique and secon how to retrieve that unquie data from Impromptu.
 
dm21, I'm sorry but I'm just not understanding your full requirement. Here is my guess at what you are trying to do. Let me know if I'm wrong.

1. User requests Report A to run.
2. All records of User requesting Report A should be removed from the table.
3. A new record should be added to the table stating User requested Report A.
4. Report A runs.

How far off track am I?

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
DoubleD,
You are correct, I have added more info:

1. User requests Report A to run.

2. All records of User requesting Report A should be removed from the table. (Within Stored Procedures)

3. A new record should be added to the table stating User requested Report A. (Within Stored Procedures)

4. Report A runs from Impromptu (By Filtering User id and report id)
 
By taking the steps in this order, I don't see how date/time is a factor. All you're doing is deleting all instances of the specified USER_ID & REPORT_ID. Then adding in one record for USER_ID & REPORT_ID.

So based on this process, where's the problem? A user can't run the same report instantaneously, so even if they kick off the report back-to-back, the stored procedures should still work.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
DoubleD,

I did have a problem when I have scheduled my reports. My Monthly reports run for longer period. Within the same macro I create a new object for Impromptu.

So, one of my monthly report runs twice with different parameters which got conflicted. so this is what happened

1 - Report 1 with parameter A runs and deletes data from table based on user id and report id and saves data for parameter A
2 - In mean while report 1 kicks off with parameter B and deletes data based on user id and report id( which indeed deleted data for parameter A)
3 - Finally both report had data for Parameter B instead of different values.

I hope this is clear.
 
You could store the parameter being sent to your report, or save separate versions of your monthly report so your ReportId would be different. It's really up to you regarding how you need to differentiate these two. It all depends on what you're using this data for.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top