1798: -- check to see if row already exists
1799: --
1800: l_sql_stmt := 'select 1 ' ||
1801: 'from ak_inst_attribute_values ' || l_where_clause;
1802: l_sql_csr := dbms_sql.open_cursor;
1803: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
1804: dbms_sql.define_column(l_sql_csr, 1, l_dummy);
1805:
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1799: --
1800: l_sql_stmt := 'select 1 ' ||
1801: 'from ak_inst_attribute_values ' || l_where_clause;
1802: l_sql_csr := dbms_sql.open_cursor;
1803: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
1804: dbms_sql.define_column(l_sql_csr, 1, l_dummy);
1805:
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1807: p_database_object_name);
1800: l_sql_stmt := 'select 1 ' ||
1801: 'from ak_inst_attribute_values ' || l_where_clause;
1802: l_sql_csr := dbms_sql.open_cursor;
1803: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
1804: dbms_sql.define_column(l_sql_csr, 1, l_dummy);
1805:
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1807: p_database_object_name);
1808: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
1802: l_sql_csr := dbms_sql.open_cursor;
1803: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
1804: dbms_sql.define_column(l_sql_csr, 1, l_dummy);
1805:
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1807: p_database_object_name);
1808: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
1809: p_attribute_application_id);
1810: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
1804: dbms_sql.define_column(l_sql_csr, 1, l_dummy);
1805:
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1807: p_database_object_name);
1808: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
1809: p_attribute_application_id);
1810: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
1811: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
1812: if (l_key_value2 is not null) then
1806: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
1807: p_database_object_name);
1808: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
1809: p_attribute_application_id);
1810: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
1811: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
1812: if (l_key_value2 is not null) then
1813: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
1814: end if;
1807: p_database_object_name);
1808: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
1809: p_attribute_application_id);
1810: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
1811: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
1812: if (l_key_value2 is not null) then
1813: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
1814: end if;
1815: if (l_key_value3 is not null) then
1809: p_attribute_application_id);
1810: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
1811: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
1812: if (l_key_value2 is not null) then
1813: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
1814: end if;
1815: if (l_key_value3 is not null) then
1816: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
1817: end if;
1812: if (l_key_value2 is not null) then
1813: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
1814: end if;
1815: if (l_key_value3 is not null) then
1816: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
1817: end if;
1818: if (l_key_value4 is not null) then
1819: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
1820: end if;
1815: if (l_key_value3 is not null) then
1816: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
1817: end if;
1818: if (l_key_value4 is not null) then
1819: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
1820: end if;
1821: if (l_key_value5 is not null) then
1822: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
1823: end if;
1818: if (l_key_value4 is not null) then
1819: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
1820: end if;
1821: if (l_key_value5 is not null) then
1822: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
1823: end if;
1824: if (l_key_value6 is not null) then
1825: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
1826: end if;
1821: if (l_key_value5 is not null) then
1822: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
1823: end if;
1824: if (l_key_value6 is not null) then
1825: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
1826: end if;
1827: if (l_key_value7 is not null) then
1828: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
1829: end if;
1824: if (l_key_value6 is not null) then
1825: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
1826: end if;
1827: if (l_key_value7 is not null) then
1828: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
1829: end if;
1830: if (l_key_value8 is not null) then
1831: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
1832: end if;
1827: if (l_key_value7 is not null) then
1828: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
1829: end if;
1830: if (l_key_value8 is not null) then
1831: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
1832: end if;
1833: if (l_key_value9 is not null) then
1834: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
1835: end if;
1830: if (l_key_value8 is not null) then
1831: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
1832: end if;
1833: if (l_key_value9 is not null) then
1834: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
1835: end if;
1836: if (l_key_value10 is not null) then
1837: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
1838: end if;
1833: if (l_key_value9 is not null) then
1834: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
1835: end if;
1836: if (l_key_value10 is not null) then
1837: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
1838: end if;
1839:
1840: if (dbms_sql.execute_and_fetch(l_sql_csr) = 0) then
1841: dbms_sql.close_cursor(l_sql_csr);
1836: if (l_key_value10 is not null) then
1837: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
1838: end if;
1839:
1840: if (dbms_sql.execute_and_fetch(l_sql_csr) = 0) then
1841: dbms_sql.close_cursor(l_sql_csr);
1842: p_return_status := FND_API.G_RET_STS_SUCCESS;
1843: return FALSE;
1844: else
1837: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
1838: end if;
1839:
1840: if (dbms_sql.execute_and_fetch(l_sql_csr) = 0) then
1841: dbms_sql.close_cursor(l_sql_csr);
1842: p_return_status := FND_API.G_RET_STS_SUCCESS;
1843: return FALSE;
1844: else
1845: dbms_sql.close_cursor(l_sql_csr);
1841: dbms_sql.close_cursor(l_sql_csr);
1842: p_return_status := FND_API.G_RET_STS_SUCCESS;
1843: return FALSE;
1844: else
1845: dbms_sql.close_cursor(l_sql_csr);
1846: p_return_status := FND_API.G_RET_STS_SUCCESS;
1847: return TRUE;
1848: end if;
1849:
2737: l_where_clause := l_where_clause || 'and key_value10 = :key_value10 ';
2738: end if;
2739:
2740: l_sql_stmt := 'delete from ak_inst_attribute_values ' || l_where_clause;
2741: l_sql_csr := dbms_sql.open_cursor;
2742: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
2743:
2744: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
2745: p_database_object_name);
2738: end if;
2739:
2740: l_sql_stmt := 'delete from ak_inst_attribute_values ' || l_where_clause;
2741: l_sql_csr := dbms_sql.open_cursor;
2742: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
2743:
2744: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
2745: p_database_object_name);
2746: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
2740: l_sql_stmt := 'delete from ak_inst_attribute_values ' || l_where_clause;
2741: l_sql_csr := dbms_sql.open_cursor;
2742: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
2743:
2744: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
2745: p_database_object_name);
2746: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
2747: p_attribute_application_id);
2748: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
2742: dbms_sql.parse(l_sql_csr, l_sql_stmt, DBMS_SQL.V7);
2743:
2744: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
2745: p_database_object_name);
2746: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
2747: p_attribute_application_id);
2748: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
2749: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
2750: if (l_key_value2 is not null) then
2744: dbms_sql.bind_variable(l_sql_csr, 'database_object_name',
2745: p_database_object_name);
2746: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
2747: p_attribute_application_id);
2748: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
2749: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
2750: if (l_key_value2 is not null) then
2751: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
2752: end if;
2745: p_database_object_name);
2746: dbms_sql.bind_variable(l_sql_csr, 'attribute_application_id',
2747: p_attribute_application_id);
2748: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
2749: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
2750: if (l_key_value2 is not null) then
2751: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
2752: end if;
2753: if (l_key_value3 is not null) then
2747: p_attribute_application_id);
2748: dbms_sql.bind_variable(l_sql_csr, 'attribute_code',p_attribute_code);
2749: dbms_sql.bind_variable(l_sql_csr, 'key_value1', p_key_value1);
2750: if (l_key_value2 is not null) then
2751: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
2752: end if;
2753: if (l_key_value3 is not null) then
2754: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
2755: end if;
2750: if (l_key_value2 is not null) then
2751: dbms_sql.bind_variable(l_sql_csr, 'key_value2', l_key_value2);
2752: end if;
2753: if (l_key_value3 is not null) then
2754: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
2755: end if;
2756: if (l_key_value4 is not null) then
2757: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
2758: end if;
2753: if (l_key_value3 is not null) then
2754: dbms_sql.bind_variable(l_sql_csr, 'key_value3', l_key_value3);
2755: end if;
2756: if (l_key_value4 is not null) then
2757: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
2758: end if;
2759: if (l_key_value5 is not null) then
2760: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
2761: end if;
2756: if (l_key_value4 is not null) then
2757: dbms_sql.bind_variable(l_sql_csr, 'key_value4', l_key_value4);
2758: end if;
2759: if (l_key_value5 is not null) then
2760: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
2761: end if;
2762: if (l_key_value6 is not null) then
2763: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
2764: end if;
2759: if (l_key_value5 is not null) then
2760: dbms_sql.bind_variable(l_sql_csr, 'key_value5', l_key_value5);
2761: end if;
2762: if (l_key_value6 is not null) then
2763: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
2764: end if;
2765: if (l_key_value7 is not null) then
2766: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
2767: end if;
2762: if (l_key_value6 is not null) then
2763: dbms_sql.bind_variable(l_sql_csr, 'key_value6', l_key_value6);
2764: end if;
2765: if (l_key_value7 is not null) then
2766: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
2767: end if;
2768: if (l_key_value8 is not null) then
2769: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
2770: end if;
2765: if (l_key_value7 is not null) then
2766: dbms_sql.bind_variable(l_sql_csr, 'key_value7', l_key_value7);
2767: end if;
2768: if (l_key_value8 is not null) then
2769: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
2770: end if;
2771: if (l_key_value9 is not null) then
2772: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
2773: end if;
2768: if (l_key_value8 is not null) then
2769: dbms_sql.bind_variable(l_sql_csr, 'key_value8', l_key_value8);
2770: end if;
2771: if (l_key_value9 is not null) then
2772: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
2773: end if;
2774: if (l_key_value10 is not null) then
2775: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
2776: end if;
2771: if (l_key_value9 is not null) then
2772: dbms_sql.bind_variable(l_sql_csr, 'key_value9', l_key_value9);
2773: end if;
2774: if (l_key_value10 is not null) then
2775: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
2776: end if;
2777:
2778: if (dbms_sql.execute(l_sql_csr) = 0) then
2779: if FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) then
2774: if (l_key_value10 is not null) then
2775: dbms_sql.bind_variable(l_sql_csr, 'key_value10', l_key_value10);
2776: end if;
2777:
2778: if (dbms_sql.execute(l_sql_csr) = 0) then
2779: if FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) then
2780: FND_MESSAGE.SET_NAME('AK','AK_OBJECT_DOES_NOT_EXIST');
2781: FND_MESSAGE.SET_TOKEN('OBJECT','AK_ATTRIBUTE_VALUE', TRUE);
2782: FND_MSG_PUB.Add;
2780: FND_MESSAGE.SET_NAME('AK','AK_OBJECT_DOES_NOT_EXIST');
2781: FND_MESSAGE.SET_TOKEN('OBJECT','AK_ATTRIBUTE_VALUE', TRUE);
2782: FND_MSG_PUB.Add;
2783: end if;
2784: dbms_sql.close_cursor(l_sql_csr);
2785: raise FND_API.G_EXC_ERROR;
2786: end if;
2787:
2788: dbms_sql.close_cursor(l_sql_csr);
2784: dbms_sql.close_cursor(l_sql_csr);
2785: raise FND_API.G_EXC_ERROR;
2786: end if;
2787:
2788: dbms_sql.close_cursor(l_sql_csr);
2789: --
2790: -- Load success message
2791: --
2792: if FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_SUCCESS) then