Focal Point
Saving Report Data

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1441072522

April 26, 2007, 01:29 PM
gweller
Saving Report Data
I have a daily report that I run which reports daily transactions by individuals on various tables. I would like to be able to schedule the report to run, gather the data and store it within a separate SQL database. How is this best done?

Thanks in advance


WebFOCUS 8201M/Windows Platform
April 26, 2007, 01:37 PM
Darin Lee
I haven't looked into it much, but I know there is a relatively new feature that allows for hold files to be stored in databases such as DB2, Oracle (I assume SQL Server also).
Your scheduled procedures could just create (or Modify) hold files which would be stored in separate databases.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
April 26, 2007, 03:03 PM
Trav
I've had reasonable success with simply doing a hold file in a SQL format. There are a couple of caveats to be aware of:


What I would recommend is creating a stored procedure or something that you can run before you do the hold that would drop the table (if it exists). If you need to get the data from somewhere else, then hold it to a focus file first, then connect to your destination database with a different connection/adapter, run the stored procedure, and then hold the focus file out as SQL. There are probably other ways to do this, but when I was playing around with it, that's what I formulated in my head. Your environment may have other constraints that warrant a different solution. I would definitely encourage you to play with those output types though.



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
April 26, 2007, 03:13 PM
gweller
quote:
or something t


As it is daily statistics I would like to be able to store the information without removing what info is already within the SQL table, so I can do historical trending etc...but that may come in handy down the road...


WebFOCUS 8201M/Windows Platform
April 26, 2007, 03:21 PM
Trav
Well, I think what you'd do then is treat the table that gets created as a "work" table.

So as an alternative, don't run the proc before you create the table. Instead hold your file out to sql and then run a stored procedure afterwards that will move the data from the work table into your permanent table -- and then simply drop the work table when it's done.

Same basic principle, just slightly modified for keeping your data long-term.



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
April 26, 2007, 03:34 PM
Tony A
Why not use a combination of TABLE and SQL passthru?
TABLE FILE filename
other stuff
ON TABLE HOLD AS TEMPSTATS FORMAT SQLMSS (or what ever it is)
END
-RUN
-IF &LINES EQ 0 THEN :End_It;

SQL SET ENGINE etc...
SQL
  UPDATE STATSFILE
  SELECT * FROM webfocus.TEMPSTATS
;
END
-RUN
-:End_It

You will have to correct the code above as it is not meant to be totally syntactically correct (I'm at home now and have no access to prove it) but it should give you an idea to begin with.

In fact exactly as Trav suggests above Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10