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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update a database with totals from the report

Status
Not open for further replies.

jkosloski

Programmer
Jan 23, 2003
2
US
Hi All,
I need to update the database with the totals from a report. I am using WebFOCUS 4.36 and ReportCaster. We have a J2EE self service app that calls ReportCaster and then ReportCaster is supposed to generate a bill and for each bill I need to write the total back to the database. Is this possible?
 
What TYPE of database are you reading, that you then need to update?
 
I am updating an Oracle 8i database. What I would like to do is to run my report and as a total is calculated for each report, have the total written to a file and then maybe have a post process run that reads the file and then updates the Oracle database....
 

Simple.
As long as you have a master file description and access file for your oracle table (ie oracletb.mas oracletb.acx) then you can create a simple modify to update the database. In the example below, field1, field2, field3 make up the unique key to the table (as defined in the oracle database). Just create a hold file with all the elements needed to update the table in your database database.

Hope this helps....

-* NOTE oracledb should be the name associated to the
-* connection string in sqlnet for the oracle database

SQL SQLORA SET USER useid/password@oracledb


TABLE FILE REPTDATA
PRINT field5 field6 field7
by field1
by field2
by field3
ON TABLE HOLD AS savedata
END

MODIFY FILE oracletb
FIXFORM FROM savedata
MATCH field1 field2 field3
ON NOMATCH INCLUDE
ON MATCH UPDATE field5 field6 field7
DATA ON savedata
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top