519: from msc_form_query
520: where ' ||p_omit_list||
521: ' and query_id = :exception_id )';
522:
523: c := dbms_sql.open_cursor;
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
520: where ' ||p_omit_list||
521: ' and query_id = :exception_id )';
522:
523: c := dbms_sql.open_cursor;
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
521: ' and query_id = :exception_id )';
522:
523: c := dbms_sql.open_cursor;
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
529: dbms_sql.close_cursor(c);
522:
523: c := dbms_sql.open_cursor;
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
529: dbms_sql.close_cursor(c);
530:
523: c := dbms_sql.open_cursor;
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
529: dbms_sql.close_cursor(c);
530:
531: Exception
524: dbms_sql.parse(c, statement, dbms_sql.native);
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
529: dbms_sql.close_cursor(c);
530:
531: Exception
532: When no_data_found Then
525: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
526: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
527: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
528: rows_processed := dbms_sql.execute(c);
529: dbms_sql.close_cursor(c);
530:
531: Exception
532: When no_data_found Then
533: raise no_data_found;
560: where ' ||p_omit_list||
561: ' and query_id = :exception_id )'||
562: ' for update of display nowait ';
563:
564: c := dbms_sql.open_cursor;
565: dbms_sql.parse(c, statement, dbms_sql.native);
566: dbms_sql.define_column(c, 1, display_flag);
567: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
568: rows_processed := dbms_sql.execute(c);
561: ' and query_id = :exception_id )'||
562: ' for update of display nowait ';
563:
564: c := dbms_sql.open_cursor;
565: dbms_sql.parse(c, statement, dbms_sql.native);
566: dbms_sql.define_column(c, 1, display_flag);
567: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
568: rows_processed := dbms_sql.execute(c);
569: counter :=0;
562: ' for update of display nowait ';
563:
564: c := dbms_sql.open_cursor;
565: dbms_sql.parse(c, statement, dbms_sql.native);
566: dbms_sql.define_column(c, 1, display_flag);
567: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
568: rows_processed := dbms_sql.execute(c);
569: counter :=0;
570:
563:
564: c := dbms_sql.open_cursor;
565: dbms_sql.parse(c, statement, dbms_sql.native);
566: dbms_sql.define_column(c, 1, display_flag);
567: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
568: rows_processed := dbms_sql.execute(c);
569: counter :=0;
570:
571: Loop
564: c := dbms_sql.open_cursor;
565: dbms_sql.parse(c, statement, dbms_sql.native);
566: dbms_sql.define_column(c, 1, display_flag);
567: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
568: rows_processed := dbms_sql.execute(c);
569: counter :=0;
570:
571: Loop
572: IF (dbms_sql.fetch_rows(c) >0) THEN
568: rows_processed := dbms_sql.execute(c);
569: counter :=0;
570:
571: Loop
572: IF (dbms_sql.fetch_rows(c) >0) THEN
573: dbms_sql.column_value(c, 1, display_flag);
574: IF display_flag <> 1 THEN
575: -- record already changed
576: return 2;
569: counter :=0;
570:
571: Loop
572: IF (dbms_sql.fetch_rows(c) >0) THEN
573: dbms_sql.column_value(c, 1, display_flag);
574: IF display_flag <> 1 THEN
575: -- record already changed
576: return 2;
577: END IF;
579: ELSE
580: exit;
581: END IF;
582: END Loop;
583: dbms_sql.close_cursor(c);
584: IF counter = 0 THEN
585: -- no matching records , record already deleted
586: return 1;
587: ELSE
592:
593: EXCEPTION
594: WHEN others THEN
595: --can not lock the record, because the record is locked by other users already
596: IF dbms_sql.is_open(c) THEN
597: dbms_sql.close_cursor(c);
598: END IF;
599: raise_application_error(-20020,sqlerrm||':'||statement);
600:
593: EXCEPTION
594: WHEN others THEN
595: --can not lock the record, because the record is locked by other users already
596: IF dbms_sql.is_open(c) THEN
597: dbms_sql.close_cursor(c);
598: END IF;
599: raise_application_error(-20020,sqlerrm||':'||statement);
600:
601: END lock_row;