How to Call the Packages - Intergraph Smart Materials - Version 10.2 - Customization & Programming - Hexagon

Intergraph Smart Materials Classic API Configuration (10.2)

Language
English
Product
Intergraph Smart Materials
Subproduct
Classic
Search by Category
Customization & Programming
Smart Materials/Smart Reference Data Version
10.2

To update a column, the packages can use the following syntax:

m_api_xxx.upd_xxx (us_id, pk_id, l_col_rec, result);

To insert a record, the packages can be called using the following syntax:

m_api_xxx.ins_xxx (us_id, ... , l_col_rec, result);

Here the xxx must be replaced by the table short name or by misc.

The packages require user security information to read project defaults or privileges. Therefore, the us_id parameter is mandatory. This parameter is equivalent to the value of the column USID that you can find in the lower block of the Smart Materials logon screen.

The pk_id must be replaced by the value for the primary key of the table.

l_col_rec is a record that can be defined as:

l_col_rec m_api_xxx.t_col_rec;

t_col_rec is defined in the packages as follwoing:

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

);

The result is a parameter of type OUT which indicates if the updates or inserts were performed successfully.

The number and type of the parameters following us_id for insert procedures differ from package to package depending on the table in which a record is inserted. For information on the available packages, see Appendix: Packages and Supported Columns.

Example

If you want to update the escalation_percent, quote_recv_date, and currency_code columns in the m_quote_summaries table where the quote has a primary key of 5590, you can use a procedure with the following syntax:

CREATE OR REPLACE PROCEDURE my_proc

IS

l_col_rec m_api_qs.t_col_rec;

result VARCHAR2(255);

BEGIN

l_col_rec.col_name(1) := 'ESCALATION_PERCENT';

l_col_rec.col_value(1) := '5.3';

l_col_rec.col_name(2) := 'QUOTE_RECV_DATE';

l_col_rec.col_value(2) := '18-SEP-2000';

l_col_rec.col_name(3) := 'CURRENCY_CODE';

l_col_rec.col_value(3) := 'USD';

m_api_qs.upd_qs (5001, 5590, l_col_rec, result);

dbms_output.put_line ('Result = ' || result);

END;

/

Use uppercase for the column names.