doc-exports/docs/dws/tool/dws_mt_0301.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

163 lines
9.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000001233922145"></a><a name="EN-US_TOPIC_0000001233922145"></a>
<h1 class="topictitle1">Splitting Packages</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p3864142111911">The package specification is migrated as a schema named after the package and the procedures and functions in the package body is migrated as <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b1058188441">Packagename.procedurename </strong>and<strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b0519188445"> Packagename.funtionname</strong>.</p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p15866042141916">Migration can be performed after <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b3416193054417">pkgSchemaNaming</strong> is set to <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b12416153017448">true</strong>.</p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p178664426192"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b188527408432">Input PACKAGE1.FUNC1</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen1986610424198">CREATE OR REPLACE PACKAGE BODY pack AS
FUNCTION get_fullname(n_emp_id NUMBER) RETURN VARCHAR2 IS
v_fullname VARCHAR2(46);
BEGIN
SELECT first_name || ',' || last_name
INTO v_fullname
FROM employees
WHERE employee_id = n_emp_id;
RETURN v_fullname;
END get_fullname;
PROCEDURE get_salary(n_emp_id NUMBER) RETURN NUMBER IS
n_salary NUMBER(8,2);
BEGIN
SELECT salary
INTO n_salary
FROM employees
WHERE employee_id = n_emp_id;
END get_salary;
END pack;
/</pre>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p18679429192"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b926192111311">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen19867184241919">CREATE
OR REPLACE FUNCTION pack.get_fullname ( n_emp_id NUMBER )
RETURN VARCHAR2 IS v_fullname VARCHAR2 ( 46 ) ;
BEGIN
SELECT
first_name || ',' || last_name INTO v_fullname
FROM
employees
WHERE
employee_id = n_emp_id ;
RETURN v_fullname ;
END ;
/
CREATE
OR REPLACE FUNCTION pack.get_salary ( n_emp_id NUMBER )
RETURN NUMBER IS n_salary NUMBER ( 8 ,2 ) ;
BEGIN
SELECT
salary INTO n_salary
FROM
employees
WHERE
employee_id = n_emp_id ;
RETURN n_salary ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p71922817135"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b785118217451">If </strong><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b206221219452">pkgSchemaNaming </strong><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b18511521184514">is set to </strong><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b186226116458">false</strong><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b138519217453">, packages can be split.</strong></p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p1222052115719">When <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b16228133717458">bas_lookup_misc_pkg</strong> is calling <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b1722883754512">insert_fnd_data_change_logs</strong>, <strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b112284374454">insert_fnd_data_change_logs </strong>will be not migrated.</p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p13421811311"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b17435182655820">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen255316376586">CREATE OR REPLACE PACKAGE BODY SAD.bas_dml_lookup_pkg IS
g_pkg_name CONSTANT VARCHAR2(30) := 'bas_dml_ic_price_rule_pkg' ;
g_func_name VARCHAR2(100);
FUNCTION func_name
RETURN VARCHAR2
IS
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := g_pkg_name || '.' || g_func_name ;
RETURN l_func_name ;
END ;
PROCEDURE data_change_logs ( pi_table_name IN VARCHAR2
, pi_table_key_columns IN VARCHAR2
, po_error_msg OUT VARCHAR2
)
IS
BEGIN
g_func_name := 'insert_fnd_data_change_logs_t';
INSERT INTO fnd_data_change_logs_t
( logid, table_name, table_key_columns )
VALUES
( fnd_data_change_logs_t_s.NEXTVAL
, pi_table_name, pi_table_key_columns );
EXCEPTION
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || func_name || ',' || SQLERRM;
END data_change_logs;
END bas_dml_lookup_pkg;
/</pre>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p5497168171313"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b1310212580113">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen53181249711">CREATE OR REPLACE FUNCTION SAD.bas_dml_lookup_pkg#func_name
RETURN VARCHAR2
IS
MIG_PV_VAL_DUMMY_G_PKG_NAME VARCHAR2(30) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_PKG_NAME' )::VARCHAR2(30) ;
MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2(100) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME' )::VARCHAR2(100) ;
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := MIG_PV_VAL_DUMMY_G_PKG_NAME || '.' || MIG_PV_VAL_DUMMY_G_FUNC_NAME ;
RETURN l_func_name ;
END ;
/
CREATE OR REPLACE PROCEDURE SAD.bas_dml_lookup_pkg#data_change_logs ( pi_table_name IN VARCHAR2
, pi_table_key_columns IN VARCHAR2
, po_error_msg OUT VARCHAR2 )
IS
MIG_PV_VAL_DUMMY_G_FUNC_NAME VARCHAR2(30) := MIG_ORA_EXT.MIG_FN_GET_PKG_VARIABLE ( 'SAD' ,'BAS_DML_LOOKUP_PKG' ,'G_FUNC_NAME' )::VARCHAR2(30) ;
BEGIN
MIG_PV_VAL_DUMMY_G_FUNC_NAME := 'insert_fnd_data_change_logs_t' ;
INSERT INTO fnd_data_change_logs_t (
logid,table_name,table_key_columns )
VALUES ( NEXTVAL ( 'fnd_data_change_logs_t_s' )
, pi_table_name, pi_table_key_columns ) ;
MIG_ORA_EXT.MIG_FN_SET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME', MIG_PV_VAL_DUMMY_G_FUNC_NAME ) ;
EXCEPTION
WHEN OTHERS THEN
po_error_msg := 'Others Exception raise in ' || SAD.bas_dml_lookup_pkg#func_name( ) || ',' || SQLERRM ;
MIG_ORA_EXT.MIG_FN_SET_PKG_VARIABLE ( 'SAD', 'BAS_DML_LOOKUP_PKG', 'G_FUNC_NAME', MIG_PV_VAL_DUMMY_G_FUNC_NAME ) ;
END ;
/</pre>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p5205122819594"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b1612417247125">PACKAGE Keyword</strong></p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p641102614123">The kernel needs to add the package tag to the functions and stored procedures converted from the package.</p>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p1657714391217"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b117991650121215">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen62201955191216">CREATE OR REPLACE PACKAGE BODY SAD.bas_dml_lookup_pkg IS
FUNCTION func_name
RETURN VARCHAR2
IS
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := 'bas_dml_lookup_pkg' || '.' || 'func_name' ;
RETURN l_func_name ;
END ;
END bas_dml_lookup_pkg ;
/</pre>
<p id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_p93421781216"><strong id="EN-US_TOPIC_0000001233922145__en-us_topic_0237712445_b13538316191316">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001233922145__en-us_topic_0238518407_en-us_topic_0237362317_en-us_topic_0202727191_screen153794237131">CREATE OR REPLACE FUNCTION func_name
RETURN VARCHAR2
PACKAGE
IS
l_func_name VARCHAR2(100) ;
BEGIN
l_func_name := 'bas_dml_lookup_pkg' || '.' || 'func_name' ;
RETURN l_func_name ;
END ;
/</pre>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_mt_0156.html">PL/SQL Packages</a></div>
</div>
</div>