Menu

spcmd.def

Nicola Pibiri

spcmd.def

this file is fully customizable.
The "out of the box" version contains same example based on DBA utilities and HR sample data model (can be downloaded from oracle.com)

Connections

first of all you should change the file used to connect to Oracle:
Locate the lines beginning with "CONN;" and adjust them, for example:
CONN;A;conn_HR;HR-TEST;I;C
where
"CONN" is a fixed strign
"A" is the shortcut for this connection (don't repeat it)
"conn_HR" defines the name of the script (conn_HR.sql), a file containing the connection string (something like "connect HR/HR@DBNIC") and should stay on "sql" path
HR-TEST is the name of this connection
C is the color-code for this connection
create new conn_*.sql files and

After configuring the connections, you can organize the menus
for each menu screen you should insert a line on spcmd.def defining it
HR;FN_MENU;INTERNAL;Human Resources;I
where
"HR" is the code for this menu
"FN_MENU" (fixed) defines that it is a menu
"INTERNAL" (fixed)
"Human Resource" is the description of this menu
"I" (fixed strinng)
Moreover you should insert a line to position the menu into another one
REL;ROOT;HR;J;NULL;NULL;W
where
"REL" (fixed)
"ROOT" defines parent menu code
"HR" defines the child menu code
"J" defines the shortcut
"NULL" not used here
"NULL" not used here
"W" is the color-code

NB; the starting menu is called "ROOT" (configured in spcmd.env) and it dows not ave a "REL" entry because it is the first menu

SQL Scripts

Now you can add SQL scripts to menu page
for each sql script you should insert a line on spcmd.def defining it
HRE;HR_employees;SQL;HR EMPLOYEES;I;
where
"HRE" is the code for this script
"HR_employees" defines the name of the script (HR_employees.sql)
"SQL" (fixed)
"HR EMPLOYEES" is the description of this script
"I" (fixed strinng)
Moreover you should insert a line to position the script into a menu screen
REL;HR;HRE;Y;NULL;HRE;G
where
"REL" (fixed)
"HR" defines parent menu code
"HRE" defines the script code
"Y" defines the shortcut
"NULL" not used here
"HRE" is the &SQL_ACTION parameter used in thi script
"G" is the color-code

SQL scripts my be related each other like this, In this example, by pressing "D" the program get the value of the column DEPARTMENT_ID , ancd execute the script identied by code HRE passing it as first parameter (&1).
This will work for every result set containint the column DEPARTMENT_ID, no need to configure it every time you have a query returning thi column
C;DEPARTMENT_ID;D;HRD;HRDD;COL_KEY
where
"C" (fixed)
"DEPARTMENT_ID" defines the name of the column
"D" defines the shortcut
"HRD" is the code of the sql script called
"HRDD" value for parameter SQL_ACTION
"COL_KEY" (fixed)

Similarly you can pass 2 or more columns. In this example you pass a parameter with the values of DEPARTMENT_ID and LOCATION_ID (separated by '.') to the script with code HREDV and SQL_ACTION parameter HREDV3
C;DEPARTMENT_ID.LOCATION_ID;U;HREDV;HREDV3;COL_KEY

back to [Home]


Related

Wiki: Home
Wiki: Managing colors

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.