I am looking for a way to load reports into a DB without having to use the
X-Interface of Data Workbench. Is there any way to do it through the command
line or through isql? Presumably a report is a Sybase object like any other,
so there would be other ways to load one?
My aim is to be able to automate the loading of reports via a script of some
kind, or make it batchable.
The setup is as follows: we have about 30 report files, all in the following
kind of format:
/*
** Sybase Report Description File - created by Data Workbench
** Name SERDEBT
** Database PILOT_DB
** Server LADA
*/
@RWVERSION 1;
@OBJECTSTART @REPORT;
@PAGEWIDTH 80;
@PAGELENGTH 66;
@RIGHTMARGIN 0;
@LEFTMARGIN 0;
@TOPMARGIN 0;
@BOTTOMMARGIN 0;
@COMMENTS RWTEXTBEGIN
RWTEXTEND;
@PROCLIST RWTEXTBEGIN
PROCESS main
PROCESS get_grand_total
RWTEXTEND;
@OBJECTEND @REPORT;
..
many more lines in the middle
..
@BOUNDARY FIRM;
@OBJECTEND @FIELD;
@OBJECTSTART @LAYOUT;
@OBJECTID 12;
@NAME result_footer;
@CLASS RESULT;
@PROCESSTYPE FREEFORM;
@COLUMN 0;
@WIDTH 0;
@HEIGHT 0;
@MOVEMENT NONE;
@BOUNDARY REDUCE_RIGHT;
@FLOATMARGIN 0;
@SLIDEMARGIN 0;
@TYPE RESULTFOOTER;
@ORDERBYLEVEL 0;
@RESULTNUMBER 0;
@BATCHID 0;
@OBJECTEND @LAYOUT;
/* End of Sybase Report Description File */
There are 2 tables that seemingly control reports: syb_reports and syb_rptperms
(these are initialised by a script $SYBASE/scripts/installrw).
We then use Sybase Data Workbench (dwb, an X-GUI) to "upload" the 30 or so
reports, one by one, into the database (Existing Reports | Actions | Copy | From
File). We then use our own scripts to set the relevant permissions in
syb_rptperms. Finally, we run the reports using $SYBASE/bin/runrw.
As you can see, this can all be done from the command line EXCEPT the step which
requires Data Workbench. What I require is some other way to "upload" the
reports into the database.
Thanks for your help.