509: from msc_form_query
510: where ' ||p_omit_list||
511: ' and query_id = :exception_id )';
512:
513: c := dbms_sql.open_cursor;
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
510: where ' ||p_omit_list||
511: ' and query_id = :exception_id )';
512:
513: c := dbms_sql.open_cursor;
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
511: ' and query_id = :exception_id )';
512:
513: c := dbms_sql.open_cursor;
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
519: dbms_sql.close_cursor(c);
512:
513: c := dbms_sql.open_cursor;
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
519: dbms_sql.close_cursor(c);
520:
513: c := dbms_sql.open_cursor;
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
519: dbms_sql.close_cursor(c);
520:
521: Exception
514: dbms_sql.parse(c, statement, dbms_sql.native);
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
519: dbms_sql.close_cursor(c);
520:
521: Exception
522: When no_data_found Then
515: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
516: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
517: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
518: rows_processed := dbms_sql.execute(c);
519: dbms_sql.close_cursor(c);
520:
521: Exception
522: When no_data_found Then
523: raise no_data_found;
550: where ' ||p_omit_list||
551: ' and query_id = :exception_id )'||
552: ' for update of display nowait ';
553:
554: c := dbms_sql.open_cursor;
555: dbms_sql.parse(c, statement, dbms_sql.native);
556: dbms_sql.define_column(c, 1, display_flag);
557: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
558: rows_processed := dbms_sql.execute(c);
551: ' and query_id = :exception_id )'||
552: ' for update of display nowait ';
553:
554: c := dbms_sql.open_cursor;
555: dbms_sql.parse(c, statement, dbms_sql.native);
556: dbms_sql.define_column(c, 1, display_flag);
557: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
558: rows_processed := dbms_sql.execute(c);
559: counter :=0;
552: ' for update of display nowait ';
553:
554: c := dbms_sql.open_cursor;
555: dbms_sql.parse(c, statement, dbms_sql.native);
556: dbms_sql.define_column(c, 1, display_flag);
557: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
558: rows_processed := dbms_sql.execute(c);
559: counter :=0;
560:
553:
554: c := dbms_sql.open_cursor;
555: dbms_sql.parse(c, statement, dbms_sql.native);
556: dbms_sql.define_column(c, 1, display_flag);
557: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
558: rows_processed := dbms_sql.execute(c);
559: counter :=0;
560:
561: Loop
554: c := dbms_sql.open_cursor;
555: dbms_sql.parse(c, statement, dbms_sql.native);
556: dbms_sql.define_column(c, 1, display_flag);
557: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
558: rows_processed := dbms_sql.execute(c);
559: counter :=0;
560:
561: Loop
562: IF (dbms_sql.fetch_rows(c) >0) THEN
558: rows_processed := dbms_sql.execute(c);
559: counter :=0;
560:
561: Loop
562: IF (dbms_sql.fetch_rows(c) >0) THEN
563: dbms_sql.column_value(c, 1, display_flag);
564: IF display_flag <> 1 THEN
565: -- record already changed
566: return 2;
559: counter :=0;
560:
561: Loop
562: IF (dbms_sql.fetch_rows(c) >0) THEN
563: dbms_sql.column_value(c, 1, display_flag);
564: IF display_flag <> 1 THEN
565: -- record already changed
566: return 2;
567: END IF;
569: ELSE
570: exit;
571: END IF;
572: END Loop;
573: dbms_sql.close_cursor(c);
574: IF counter = 0 THEN
575: -- no matching records , record already deleted
576: return 1;
577: ELSE
582:
583: EXCEPTION
584: WHEN others THEN
585: --can not lock the record, because the record is locked by other users already
586: IF dbms_sql.is_open(c) THEN
587: dbms_sql.close_cursor(c);
588: END IF;
589: raise_application_error(-20020,sqlerrm||':'||statement);
590:
583: EXCEPTION
584: WHEN others THEN
585: --can not lock the record, because the record is locked by other users already
586: IF dbms_sql.is_open(c) THEN
587: dbms_sql.close_cursor(c);
588: END IF;
589: raise_application_error(-20020,sqlerrm||':'||statement);
590:
591: END lock_row;