358: L_stmt := L_stmt || 'AND l2.project_id = :project_id ' ||
359: 'AND l2.task_id = :task_id';
360: end if;
361: end if;
362: c := dbms_sql.open_cursor;
363: dbms_sql.parse(c, l_stmt, dbms_sql.native);
364: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
365: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
366: if (X_project_id is not null) then
359: 'AND l2.task_id = :task_id';
360: end if;
361: end if;
362: c := dbms_sql.open_cursor;
363: dbms_sql.parse(c, l_stmt, dbms_sql.native);
364: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
365: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
366: if (X_project_id is not null) then
367: dbms_sql.bind_variable(c, 'project_id', X_project_id);
360: end if;
361: end if;
362: c := dbms_sql.open_cursor;
363: dbms_sql.parse(c, l_stmt, dbms_sql.native);
364: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
365: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
366: if (X_project_id is not null) then
367: dbms_sql.bind_variable(c, 'project_id', X_project_id);
368: end if;
361: end if;
362: c := dbms_sql.open_cursor;
363: dbms_sql.parse(c, l_stmt, dbms_sql.native);
364: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
365: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
366: if (X_project_id is not null) then
367: dbms_sql.bind_variable(c, 'project_id', X_project_id);
368: end if;
369: if (X_task_id is not null) then
363: dbms_sql.parse(c, l_stmt, dbms_sql.native);
364: dbms_sql.bind_variable(c, 'org_id', X_organization_id);
365: dbms_sql.bind_variable(c, 'locator_id', X_locator_id);
366: if (X_project_id is not null) then
367: dbms_sql.bind_variable(c, 'project_id', X_project_id);
368: end if;
369: if (X_task_id is not null) then
370: dbms_sql.bind_variable(c, 'task_id', X_task_id);
371: end if;
366: if (X_project_id is not null) then
367: dbms_sql.bind_variable(c, 'project_id', X_project_id);
368: end if;
369: if (X_task_id is not null) then
370: dbms_sql.bind_variable(c, 'task_id', X_task_id);
371: end if;
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
368: end if;
369: if (X_task_id is not null) then
370: dbms_sql.bind_variable(c, 'task_id', X_task_id);
371: end if;
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
369: if (X_task_id is not null) then
370: dbms_sql.bind_variable(c, 'task_id', X_task_id);
371: end if;
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
370: dbms_sql.bind_variable(c, 'task_id', X_task_id);
371: end if;
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
371: end if;
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
379: dbms_sql.column_value(c,3,L_subinv_match);
372: dbms_sql.define_column(c,1,L_locator_id);
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
379: dbms_sql.column_value(c,3,L_subinv_match);
380: else
373: dbms_sql.define_column(c,2,L_subinv,10);
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
379: dbms_sql.column_value(c,3,L_subinv_match);
380: else
381: L_locator_id := -1;
374: dbms_sql.define_column(c,3,L_subinv_match);
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
379: dbms_sql.column_value(c,3,L_subinv_match);
380: else
381: L_locator_id := -1;
382: L_subinv_match := null;
375: rows_processed := dbms_sql.execute(c);
376: if dbms_sql.fetch_rows(c) > 0 then
377: dbms_sql.column_value(c,1,L_locator_id);
378: dbms_sql.column_value(c,2,L_subinv);
379: dbms_sql.column_value(c,3,L_subinv_match);
380: else
381: L_locator_id := -1;
382: L_subinv_match := null;
383: end if;
380: else
381: L_locator_id := -1;
382: L_subinv_match := null;
383: end if;
384: dbms_sql.close_cursor(c);
385:
386: if (L_locator_id > 0 and L_subinv_match = 0) then
387: raise subinv_mismatch;
388: end if;