47: where_clause_segment ||
48: 'GROUP BY compile_designator, display, ' ||
49: count_list;
50:
51: /*c := dbms_sql.open_cursor;
52: dbms_sql.parse(c, statement, dbms_sql.native);
53: rows_processed := dbms_sql.execute(c);
54: dbms_sql.close_cursor(c);
55: */
48: 'GROUP BY compile_designator, display, ' ||
49: count_list;
50:
51: /*c := dbms_sql.open_cursor;
52: dbms_sql.parse(c, statement, dbms_sql.native);
53: rows_processed := dbms_sql.execute(c);
54: dbms_sql.close_cursor(c);
55: */
56: --bug 5022710
49: count_list;
50:
51: /*c := dbms_sql.open_cursor;
52: dbms_sql.parse(c, statement, dbms_sql.native);
53: rows_processed := dbms_sql.execute(c);
54: dbms_sql.close_cursor(c);
55: */
56: --bug 5022710
57:
50:
51: /*c := dbms_sql.open_cursor;
52: dbms_sql.parse(c, statement, dbms_sql.native);
53: rows_processed := dbms_sql.execute(c);
54: dbms_sql.close_cursor(c);
55: */
56: --bug 5022710
57:
58: execute immediate statement using
119: ', :n,organization_id,:planned_org ) '||
120: ' and version is null ' ||
121: where_clause_segment;
122:
123: /*c := dbms_sql.open_cursor;
124: dbms_sql.parse(c, statement, dbms_sql.native);
125: rows_processed := dbms_sql.execute(c);
126: dbms_sql.close_cursor(c);
127: */
120: ' and version is null ' ||
121: where_clause_segment;
122:
123: /*c := dbms_sql.open_cursor;
124: dbms_sql.parse(c, statement, dbms_sql.native);
125: rows_processed := dbms_sql.execute(c);
126: dbms_sql.close_cursor(c);
127: */
128: --5022710
121: where_clause_segment;
122:
123: /*c := dbms_sql.open_cursor;
124: dbms_sql.parse(c, statement, dbms_sql.native);
125: rows_processed := dbms_sql.execute(c);
126: dbms_sql.close_cursor(c);
127: */
128: --5022710
129: execute immediate statement using
122:
123: /*c := dbms_sql.open_cursor;
124: dbms_sql.parse(c, statement, dbms_sql.native);
125: rows_processed := dbms_sql.execute(c);
126: dbms_sql.close_cursor(c);
127: */
128: --5022710
129: execute immediate statement using
130: exception_id,compile_designator,planning_org,planned_org,planned_org,
201: from mrp_form_query
202: where ' ||p_omit_list||
203: ' and query_id = :exception_id )';
204:
205: c := dbms_sql.open_cursor;
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
202: where ' ||p_omit_list||
203: ' and query_id = :exception_id )';
204:
205: c := dbms_sql.open_cursor;
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
203: ' and query_id = :exception_id )';
204:
205: c := dbms_sql.open_cursor;
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
211: dbms_sql.close_cursor(c);
204:
205: c := dbms_sql.open_cursor;
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
211: dbms_sql.close_cursor(c);
212:
205: c := dbms_sql.open_cursor;
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
211: dbms_sql.close_cursor(c);
212:
213: Exception
206: dbms_sql.parse(c, statement, dbms_sql.native);
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
211: dbms_sql.close_cursor(c);
212:
213: Exception
214: When no_data_found Then
207: dbms_sql.bind_variable(c,'last_update_login',p_last_update_login);
208: dbms_sql.bind_variable(c,'last_updated_by',p_last_updated_by);
209: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
210: rows_processed := dbms_sql.execute(c);
211: dbms_sql.close_cursor(c);
212:
213: Exception
214: When no_data_found Then
215: raise no_data_found;
242: where ' ||p_omit_list||
243: ' and query_id = :exception_id )'||
244: ' for update of display nowait ';
245:
246: c := dbms_sql.open_cursor;
247: dbms_sql.parse(c, statement, dbms_sql.native);
248: dbms_sql.define_column(c, 1, display_flag);
249: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
250: rows_processed := dbms_sql.execute(c);
243: ' and query_id = :exception_id )'||
244: ' for update of display nowait ';
245:
246: c := dbms_sql.open_cursor;
247: dbms_sql.parse(c, statement, dbms_sql.native);
248: dbms_sql.define_column(c, 1, display_flag);
249: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
250: rows_processed := dbms_sql.execute(c);
251: counter :=0;
244: ' for update of display nowait ';
245:
246: c := dbms_sql.open_cursor;
247: dbms_sql.parse(c, statement, dbms_sql.native);
248: dbms_sql.define_column(c, 1, display_flag);
249: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
250: rows_processed := dbms_sql.execute(c);
251: counter :=0;
252:
245:
246: c := dbms_sql.open_cursor;
247: dbms_sql.parse(c, statement, dbms_sql.native);
248: dbms_sql.define_column(c, 1, display_flag);
249: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
250: rows_processed := dbms_sql.execute(c);
251: counter :=0;
252:
253: Loop
246: c := dbms_sql.open_cursor;
247: dbms_sql.parse(c, statement, dbms_sql.native);
248: dbms_sql.define_column(c, 1, display_flag);
249: dbms_sql.bind_variable(c,'exception_id',p_exception_id);
250: rows_processed := dbms_sql.execute(c);
251: counter :=0;
252:
253: Loop
254: IF (dbms_sql.fetch_rows(c) >0) THEN
250: rows_processed := dbms_sql.execute(c);
251: counter :=0;
252:
253: Loop
254: IF (dbms_sql.fetch_rows(c) >0) THEN
255: dbms_sql.column_value(c, 1, display_flag);
256: IF display_flag <> 1 THEN
257: -- record already changed
258: return 2;
251: counter :=0;
252:
253: Loop
254: IF (dbms_sql.fetch_rows(c) >0) THEN
255: dbms_sql.column_value(c, 1, display_flag);
256: IF display_flag <> 1 THEN
257: -- record already changed
258: return 2;
259: END IF;
261: ELSE
262: exit;
263: END IF;
264: END Loop;
265: dbms_sql.close_cursor(c);
266: IF counter = 0 THEN
267: -- no matching records , record already deleted
268: return 1;
269: ELSE
274:
275: EXCEPTION
276: WHEN others THEN
277: --can not lock the record, because the record is locked by other users already
278: IF dbms_sql.is_open(c) THEN
279: dbms_sql.close_cursor(c);
280: END IF;
281: raise_application_error(-20020,sqlerrm||':'||statement);
282:
275: EXCEPTION
276: WHEN others THEN
277: --can not lock the record, because the record is locked by other users already
278: IF dbms_sql.is_open(c) THEN
279: dbms_sql.close_cursor(c);
280: END IF;
281: raise_application_error(-20020,sqlerrm||':'||statement);
282:
283: END lock_row;