To update or insert a column, the packages can be called as follows:
for line:
m_api_pll_lines.upd_line (us_id, line_id, status_id, l_col_rec, result);
m_api_pll_lines.ins_line (us_id, unit_id, status_id, l_col_rec, result);
for line nls:
m_api_pll_lines.upd_nls (us_id, line_id, nls_id, l_col_rec, result);
m_api_pll_lines.ins_nls (us_id, line_id, l_col_rec, result);
for line attributes:
m_api_pll_attrs.upd_line_attrs (us_id, attr_id, l_col_rec, result);
m_api_pll_attrs.ins_line_attrs (us_id, line_id, l_col_rec, result);
for dns:
m_api_pll_dns.upd_dn (us_id, dn_id, l_col_rec, result);
m_api_pll_dns.ins_dn (us_id, line_id, l_col_rec, result);
for dn attributes:
m_api_pll_attrs.upd_dn_attrs (us_id, attr_id, l_col_rec, result);
m_api_pll_attrs.ins_dn_attrs (us_id, dn_id, l_col_rec, result);
for branches:
m_api_pll_branches.upd_branch (us_id, branch_id, l_col_rec, result);
m_api_pll_branches.ins_branch (us_id, dn_id, l_col_rec, result);
The packages require user security information to read project defaults or privileges. Therefore, parameter us_id is needed. It is equivalent to the value of column USID you find in the lower block of the Smart Materials logon screen.
l_col_rec is a record that can be defined as:
l_col_rec m_api_pll_xxx.t_col_rec;
t_col_rec is defined in the packages like this:
TYPE t_col_table IS TABLE OF VARCHAR2(255)
INDEX BY BINARY_INTEGER;
TYPE t_col_rec IS RECORD
(col_name t_col_table,
col_value t_col_table
);
)
result is a parameter of type OUT telling you whether the updates or inserts were performed successfully or not.
The number and type of the parameters following us_id for insert procedures differs from package to package depending on the table in which a record is to be inserted. You find a full description of these parameters in the More Information section where all packages are listed.
Example:
If you want to update columns wt, unit_wt_id and pll_comment of table m_pll_dns for the DN the primary key of which has the value 6870 you can use a procedure that looks like this:
CREATE OR REPLACE PROCEDURE my_proc
IS
l_col_rec m_api_pll_dns.t_col_rec;
result VARCHAR2(255);
BEGIN
l_col_rec.col_name(1) := 'WT';
l_col_rec.col_value(1) := '100';
l_col_rec.col_name(2) := 'UNIT_WT_ID';
l_col_rec.col_value(2) := '5132';
l_col_rec.col_name(3) := 'PLL_COMMENT';
l_col_rec.col_value(3) := 'RESPONSE TO ENGINEERING';
m_api_pll_dns.upd_dns (5001, 6870, l_col_rec, result);
dbms_output.put_line ('Result = ' || result);
END;
/
Use upper case text for the column names.