[Home] [Help]
341: p_attribute_code IN VARCHAR2
342: ) return BOOLEAN is
343: cursor l_check_csr is
344: select 1
345: from AK_ATTRIBUTES
346: where attribute_application_id = p_attribute_application_id
347: and attribute_code = p_attribute_code;
348: l_api_version_number CONSTANT number := 1.0;
349: l_api_name CONSTANT varchar2(30) := 'Attribute_Exists';
820:
821: select userenv('LANG') into l_lang
822: from dual;
823:
824: insert into AK_ATTRIBUTES (
825: ATTRIBUTE_APPLICATION_ID,
826: ATTRIBUTE_CODE,
827: ATTRIBUTE_LABEL_LENGTH,
828: ATTRIBUTE_VALUE_LENGTH,
932: end if;
933: raise FND_API.G_EXC_ERROR;
934: end if;
935:
936: insert into AK_ATTRIBUTES_TL (
937: ATTRIBUTE_APPLICATION_ID,
938: ATTRIBUTE_CODE,
939: LANGUAGE,
940: NAME,
964: from FND_LANGUAGES L
965: where L.INSTALLED_FLAG in ('I', 'B')
966: and not exists
967: (select NULL
968: from AK_ATTRIBUTES_TL T
969: where T.ATTRIBUTE_APPLICATION_ID = p_attribute_application_id
970: and T.ATTRIBUTE_CODE = p_attribute_code
971: and T.LANGUAGE = L.LANGUAGE_CODE);
972:
1271: --
1272: -- delete attribute once we checked that there are no references
1273: -- to this attribute, or all references have been deleted.
1274: --
1275: delete from ak_attributes
1276: where attribute_application_id = p_attribute_application_id
1277: and attribute_code = p_attribute_code;
1278:
1279: if (sql%notfound) then
1283: end if;
1284: raise FND_API.G_EXC_ERROR;
1285: end if;
1286:
1287: delete from ak_attributes_tl
1288: where attribute_application_id = p_attribute_application_id
1289: and attribute_code = p_attribute_code;
1290:
1291: if (sql%notfound) then
1355: --=======================================================
1356: procedure WRITE_TO_BUFFER (
1357: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1358: p_return_status OUT NOCOPY VARCHAR2,
1359: p_attributes_rec IN ak_attributes%ROWTYPE,
1360: p_attributes_tl_rec IN ak_attributes_tl%ROWTYPE
1361: ) is
1362: l_api_name CONSTANT varchar2(30) := 'Write_to_buffer';
1363: l_databuffer_tbl AK_ON_OBJECTS_PUB.Buffer_Tbl_Type;
1356: procedure WRITE_TO_BUFFER (
1357: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1358: p_return_status OUT NOCOPY VARCHAR2,
1359: p_attributes_rec IN ak_attributes%ROWTYPE,
1360: p_attributes_tl_rec IN ak_attributes_tl%ROWTYPE
1361: ) is
1362: l_api_name CONSTANT varchar2(30) := 'Write_to_buffer';
1363: l_databuffer_tbl AK_ON_OBJECTS_PUB.Buffer_Tbl_Type;
1364: l_index NUMBER;
1830: p_nls_language IN VARCHAR2
1831: ) is
1832: cursor l_get_attribute_1_csr (appl_id_parm number) is
1833: select *
1834: from AK_ATTRIBUTES
1835: where ATTRIBUTE_APPLICATION_ID = appl_id_parm;
1836: cursor l_get_attribute_2_csr (appl_id_parm number,
1837: attr_code_parm varchar2) is
1838: select *
1835: where ATTRIBUTE_APPLICATION_ID = appl_id_parm;
1836: cursor l_get_attribute_2_csr (appl_id_parm number,
1837: attr_code_parm varchar2) is
1838: select *
1839: from AK_ATTRIBUTES
1840: where ATTRIBUTE_APPLICATION_ID = appl_id_parm
1841: and ATTRIBUTE_CODE = attr_code_parm;
1842: cursor l_get_attribute_2p_csr (appl_id_parm number,
1843: attr_code_parm varchar2) is
1841: and ATTRIBUTE_CODE = attr_code_parm;
1842: cursor l_get_attribute_2p_csr (appl_id_parm number,
1843: attr_code_parm varchar2) is
1844: select *
1845: from AK_ATTRIBUTES
1846: where ATTRIBUTE_APPLICATION_ID = appl_id_parm
1847: and ATTRIBUTE_CODE like attr_code_parm;
1848: cursor l_get_tl_csr (appl_id_parm number,
1849: attr_code_parm varchar2,
1848: cursor l_get_tl_csr (appl_id_parm number,
1849: attr_code_parm varchar2,
1850: lang_parm varchar2) is
1851: select *
1852: from AK_ATTRIBUTES_TL
1853: where ATTRIBUTE_APPLICATION_ID = appl_id_parm
1854: and ATTRIBUTE_CODE = attr_code_parm
1855: and LANGUAGE = lang_parm;
1856: cursor l_get_tlp_csr (appl_id_parm number,
1856: cursor l_get_tlp_csr (appl_id_parm number,
1857: attr_code_parm varchar2,
1858: lang_parm varchar2) is
1859: select *
1860: from AK_ATTRIBUTES_TL
1861: where ATTRIBUTE_APPLICATION_ID = appl_id_parm
1862: and ATTRIBUTE_CODE like attr_code_parm
1863: and LANGUAGE = lang_parm;
1864: cursor l_percent_check (attr_code_parm varchar2) is
1869: l_api_name CONSTANT varchar2(30) := 'Download';
1870: l_attribute_found BOOLEAN;
1871: i number;
1872: l_attribute_appl_id NUMBER;
1873: l_attributes_rec ak_attributes%ROWTYPE;
1874: l_attributes_tl_rec ak_attributes_tl%ROWTYPE;
1875: l_return_status varchar2(1);
1876: l_select_by_appl_id BOOLEAN;
1877: l_percent NUMBER;
1870: l_attribute_found BOOLEAN;
1871: i number;
1872: l_attribute_appl_id NUMBER;
1873: l_attributes_rec ak_attributes%ROWTYPE;
1874: l_attributes_tl_rec ak_attributes_tl%ROWTYPE;
1875: l_return_status varchar2(1);
1876: l_select_by_appl_id BOOLEAN;
1877: l_percent NUMBER;
1878: begin
1932: l_select_by_appl_id := FALSE;
1933: end if;
1934:
1935: --
1936: -- Retrieve attributes from AK_ATTRIBUTES that fits the selection
1937: -- criteria, one at a time, and write it the buffer table
1938: --
1939: if (l_select_by_appl_id) then
1940: --
2144: p_pass IN NUMBER := 1
2145: ) is
2146: l_api_version_number CONSTANT number := 1.0;
2147: l_api_name CONSTANT varchar2(30) := 'Upload_Attribute';
2148: l_attribute_rec ak_attributes%ROWTYPE;
2149: l_attribute_tl_rec AK_ATTRIBUTE_PUB.Attribute_Tl_Rec_Type;
2150: l_buffer AK_ON_OBJECTS_PUB.Buffer_Type;
2151: l_column varchar2(30);
2152: l_dummy NUMBER;
2149: l_attribute_tl_rec AK_ATTRIBUTE_PUB.Attribute_Tl_Rec_Type;
2150: l_buffer AK_ON_OBJECTS_PUB.Buffer_Type;
2151: l_column varchar2(30);
2152: l_dummy NUMBER;
2153: l_empty_attribute_rec ak_attributes%ROWTYPE;
2154: l_empty_attribute_tl_rec AK_ATTRIBUTE_PUB.Attribute_Tl_Rec_Type;
2155: l_eof_flag VARCHAR2(1);
2156: l_line_num NUMBER;
2157: l_lines_read NUMBER;
2608: if (AK_UPLOAD_GRP.G_NO_CUSTOM_UPDATE) then
2609: select aa.last_updated_by, aat.last_updated_by,
2610: aa.last_update_date, aat.last_update_date
2611: into l_user_id1, l_user_id2, l_update1, l_update2
2612: from ak_attributes aa, ak_attributes_tl aat
2613: where aa.attribute_code = l_attribute_rec.attribute_code
2614: and aa.attribute_application_id = l_attribute_rec.attribute_application_id
2615: and aa.attribute_code = aat.attribute_code
2616: and aa.attribute_application_id = aat.attribute_application_id
3113: p_copy_redo_flag IN OUT NOCOPY BOOLEAN
3114: ) is
3115: cursor l_get_row_csr is
3116: select *
3117: from AK_ATTRIBUTES
3118: where ATTRIBUTE_APPLICATION_ID = p_attribute_application_id
3119: and ATTRIBUTE_CODE = p_attribute_code
3120: for update of ATTRIBUTE_APPLICATION_ID;
3121: cursor l_get_tl_row_csr (lang_parm varchar2) is
3119: and ATTRIBUTE_CODE = p_attribute_code
3120: for update of ATTRIBUTE_APPLICATION_ID;
3121: cursor l_get_tl_row_csr (lang_parm varchar2) is
3122: select *
3123: from AK_ATTRIBUTES_TL
3124: where ATTRIBUTE_APPLICATION_ID = p_attribute_application_id
3125: and ATTRIBUTE_CODE = p_attribute_code
3126: and LANGUAGE = lang_parm
3127: for update of ATTRIBUTE_APPLICATION_ID;
3141: where ri.to_url_attribute_appl_id = p_attribute_application_id
3142: and ri.to_url_attribute_code = p_attribute_code;
3143: l_api_version_number CONSTANT number := 1.0;
3144: l_api_name CONSTANT varchar2(30) := 'Update_Attribute';
3145: l_attributes_rec ak_attributes%ROWTYPE;
3146: l_attributes_tl_rec ak_attributes_tl%ROWTYPE;
3147: l_created_by number;
3148: l_creation_date date;
3149: l_dummy number;
3142: and ri.to_url_attribute_code = p_attribute_code;
3143: l_api_version_number CONSTANT number := 1.0;
3144: l_api_name CONSTANT varchar2(30) := 'Update_Attribute';
3145: l_attributes_rec ak_attributes%ROWTYPE;
3146: l_attributes_tl_rec ak_attributes_tl%ROWTYPE;
3147: l_created_by number;
3148: l_creation_date date;
3149: l_dummy number;
3150: l_error boolean;
3174: select userenv('LANG') into l_lang
3175: from dual;
3176:
3177: --
3178: -- retrieve ak_attributes row if it exists
3179: --
3180: open l_get_row_csr;
3181: fetch l_get_row_csr into l_attributes_rec;
3182: if (l_get_row_csr%notfound) then
3189: end if;
3190: close l_get_row_csr;
3191:
3192: --
3193: -- retrieve ak_attributes_tl row if it exists
3194: --
3195: open l_get_tl_row_csr(l_lang);
3196: fetch l_get_tl_row_csr into l_attributes_tl_rec;
3197: if (l_get_tl_row_csr%notfound) then
3505: p_db_last_update_date => l_attributes_rec.last_update_date,
3506: p_last_update_login => l_last_update_login,
3507: p_create_or_update => 'UPDATE') then
3508:
3509: update AK_ATTRIBUTES set
3510: ATTRIBUTE_LABEL_LENGTH = l_attributes_rec.attribute_label_length,
3511: ATTRIBUTE_VALUE_LENGTH = l_attributes_rec.attribute_value_length,
3512: BOLD = l_attributes_rec.bold,
3513: ITALIC = l_attributes_rec.italic,
3558: end if;
3559: raise FND_API.G_EXC_ERROR;
3560: end if;
3561:
3562: update AK_ATTRIBUTES_TL set
3563: NAME = l_attributes_tl_rec.name,
3564: ATTRIBUTE_LABEL_LONG = l_attributes_tl_rec.attribute_label_long,
3565: ATTRIBUTE_LABEL_SHORT = l_attributes_tl_rec.attribute_label_short,
3566: DESCRIPTION = l_attributes_tl_rec.description,