343: L_stmt := L_stmt || 'AND l2.project_id = :project_id ' ||
344: 'AND l2.task_id = :task_id';
345: end if;
346: end if;
347: c := dbms_sql.open_cursor;
348: dbms_sql.parse(c, l_stmt, dbms_sql.native);
349: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
350: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
351: if (X_project_id is not null) then
344: 'AND l2.task_id = :task_id';
345: end if;
346: end if;
347: c := dbms_sql.open_cursor;
348: dbms_sql.parse(c, l_stmt, dbms_sql.native);
349: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
350: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
351: if (X_project_id is not null) then
352: dbms_sql.bind_variable(c, 'project_id', X_project_id);
345: end if;
346: end if;
347: c := dbms_sql.open_cursor;
348: dbms_sql.parse(c, l_stmt, dbms_sql.native);
349: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
350: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
351: if (X_project_id is not null) then
352: dbms_sql.bind_variable(c, 'project_id', X_project_id);
353: end if;
346: end if;
347: c := dbms_sql.open_cursor;
348: dbms_sql.parse(c, l_stmt, dbms_sql.native);
349: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
350: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
351: if (X_project_id is not null) then
352: dbms_sql.bind_variable(c, 'project_id', X_project_id);
353: end if;
354: if (X_task_id is not null) then
348: dbms_sql.parse(c, l_stmt, dbms_sql.native);
349: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
350: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
351: if (X_project_id is not null) then
352: dbms_sql.bind_variable(c, 'project_id', X_project_id);
353: end if;
354: if (X_task_id is not null) then
355: dbms_sql.bind_variable(c, 'task_id', X_task_id);
356: end if;
351: if (X_project_id is not null) then
352: dbms_sql.bind_variable(c, 'project_id', X_project_id);
353: end if;
354: if (X_task_id is not null) then
355: dbms_sql.bind_variable(c, 'task_id', X_task_id);
356: end if;
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
353: end if;
354: if (X_task_id is not null) then
355: dbms_sql.bind_variable(c, 'task_id', X_task_id);
356: end if;
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
354: if (X_task_id is not null) then
355: dbms_sql.bind_variable(c, 'task_id', X_task_id);
356: end if;
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
355: dbms_sql.bind_variable(c, 'task_id', X_task_id);
356: end if;
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
356: end if;
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
364: dbms_sql.column_value(c,3,L_subinv_match);
357: dbms_sql.define_column(c,1,L_locator_id);
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
364: dbms_sql.column_value(c,3,L_subinv_match);
365: else
358: dbms_sql.define_column(c,2,L_subinv,10);
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
364: dbms_sql.column_value(c,3,L_subinv_match);
365: else
366: L_locator_id := -1;
359: dbms_sql.define_column(c,3,L_subinv_match);
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
364: dbms_sql.column_value(c,3,L_subinv_match);
365: else
366: L_locator_id := -1;
367: L_subinv_match := null;
360: rows_processed := dbms_sql.execute(c);
361: if dbms_sql.fetch_rows(c) > 0 then
362: dbms_sql.column_value(c,1,L_locator_id);
363: dbms_sql.column_value(c,2,L_subinv);
364: dbms_sql.column_value(c,3,L_subinv_match);
365: else
366: L_locator_id := -1;
367: L_subinv_match := null;
368: end if;
365: else
366: L_locator_id := -1;
367: L_subinv_match := null;
368: end if;
369: dbms_sql.close_cursor(c);
370:
371: if (L_locator_id > 0 and L_subinv_match = 0) then
372: raise subinv_mismatch;
373: end if;