197:
198: buffer := 'BEGIN ';
199: for idx in 1..Num_Columns loop
200: if Rep_Columns(idx).insert_column_name is not null then
201: buffer := buffer ||'dbms_sql.bind_variable('||to_char(p_cursor)||
202: ', '':b'||to_char(idx)||
203: ''', '||Rep_Columns(idx).placeholder_name||');
204: ';
205: end if;
209: IF (g_print_debug) THEN
210: fa_rx_util_pkg.debug('bind_insert: ' || buffer);
211: END IF;
212:
213: c := dbms_sql.open_cursor;
214: dbms_sql.parse(c, buffer, dbms_sql.native);
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
210: fa_rx_util_pkg.debug('bind_insert: ' || buffer);
211: END IF;
212:
213: c := dbms_sql.open_cursor;
214: dbms_sql.parse(c, buffer, dbms_sql.native);
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
211: END IF;
212:
213: c := dbms_sql.open_cursor;
214: dbms_sql.parse(c, buffer, dbms_sql.native);
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
212:
213: c := dbms_sql.open_cursor;
214: dbms_sql.parse(c, buffer, dbms_sql.native);
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
220: dbms_sql.bind_variable(p_cursor, 'b_login_id', Login_Id);
214: dbms_sql.parse(c, buffer, dbms_sql.native);
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
220: dbms_sql.bind_variable(p_cursor, 'b_login_id', Login_Id);
221: dbms_sql.bind_variable(p_cursor, 'b_today', Today);
222:
215: rows := dbms_sql.execute(c);
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
220: dbms_sql.bind_variable(p_cursor, 'b_login_id', Login_Id);
221: dbms_sql.bind_variable(p_cursor, 'b_today', Today);
222:
223: IF (g_print_debug) THEN
216: dbms_sql.close_cursor(c);
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
220: dbms_sql.bind_variable(p_cursor, 'b_login_id', Login_Id);
221: dbms_sql.bind_variable(p_cursor, 'b_today', Today);
222:
223: IF (g_print_debug) THEN
224: fa_rx_util_pkg.debug('fa_rx_util_pkg.bind_insert()-');
217:
218: dbms_sql.bind_variable(p_cursor, 'b_request_id', Request_Id);
219: dbms_sql.bind_variable(p_cursor, 'b_user_id', User_Id);
220: dbms_sql.bind_variable(p_cursor, 'b_login_id', Login_Id);
221: dbms_sql.bind_variable(p_cursor, 'b_today', Today);
222:
223: IF (g_print_debug) THEN
224: fa_rx_util_pkg.debug('fa_rx_util_pkg.bind_insert()-');
225: END IF;
234: --
235: -- Description
236: -- When using dynamic SQL with a SELECT statement,
237: -- the select list must be described via a call to
238: -- dbms_sql.define_column.
239: -- This procedure does this.
240: --
241: -- Modificaiton History
242: -- KMIZUTA 12-MAR-99 Created.
270: if Rep_Columns(idx).select_column_name is not null then
271:
272: if Rep_Columns(idx).column_type = 'VARCHAR2' then
273:
274: dbms_sql.define_column(
275: c => p_cursor,
276: position => sel_idx,
277: column => l_varchar,
278: column_size => to_char(Rep_Columns(idx).column_length));
278: column_size => to_char(Rep_Columns(idx).column_length));
279:
280: elsif Rep_Columns(idx).column_type = 'NUMBER' then
281:
282: dbms_sql.define_column(
283: c => p_cursor,
284: position => sel_idx,
285: column => l_number);
286:
285: column => l_number);
286:
287: elsif Rep_Columns(idx).column_type = 'DATE' then
288:
289: dbms_sql.define_column(
290: c => p_cursor,
291: position => sel_idx,
292: column => l_date);
293: else
291: position => sel_idx,
292: column => l_date);
293: else
294:
295: dbms_sql.define_column(
296: c => p_cursor,
297: position => sel_idx,
298: column => l_number);
299: end if;
305: /*
306: buffer := 'BEGIN ';
307: for idx in 1..Num_Columns loop
308: if Rep_Columns(idx).select_column_name is not null then
309: buffer := buffer ||'dbms_sql.define_column('||
310: to_char(p_cursor)||', '||
311: to_char(sel_idx)||', '||
312: Rep_Columns(idx).placeholder_name;
313: if Rep_Columns(idx).column_type = 'VARCHAR2' then
323: IF (g_print_debug) THEN
324: fa_rx_util_pkg.debug('define_columns: ' || buffer);
325: END IF;
326:
327: c := dbms_sql.open_cursor;
328: dbms_sql.parse(c, buffer, dbms_sql.native);
329: rows := dbms_sql.execute(c);
330: dbms_sql.close_cursor(c);
331: */
324: fa_rx_util_pkg.debug('define_columns: ' || buffer);
325: END IF;
326:
327: c := dbms_sql.open_cursor;
328: dbms_sql.parse(c, buffer, dbms_sql.native);
329: rows := dbms_sql.execute(c);
330: dbms_sql.close_cursor(c);
331: */
332:
325: END IF;
326:
327: c := dbms_sql.open_cursor;
328: dbms_sql.parse(c, buffer, dbms_sql.native);
329: rows := dbms_sql.execute(c);
330: dbms_sql.close_cursor(c);
331: */
332:
333: IF (g_print_debug) THEN
326:
327: c := dbms_sql.open_cursor;
328: dbms_sql.parse(c, buffer, dbms_sql.native);
329: rows := dbms_sql.execute(c);
330: dbms_sql.close_cursor(c);
331: */
332:
333: IF (g_print_debug) THEN
334: fa_rx_util_pkg.debug('fa_rx_util_pkg.define_columns()-');
345: --
346: -- Description
347: -- When using dynamic SQL with a SELECT statement,
348: -- the values from the select list must be retrieved using
349: -- dbms_sql.column_value.
350: -- This procedure does this.
351: --
352: -- Modificaiton History
353: -- KMIZUTA 12-MAR-99 Created.
369: sel_idx := 1;
370: buffer := 'BEGIN ';
371: for idx in 1..Num_Columns loop
372: if Rep_Columns(idx).select_column_name is not null then
373: buffer := buffer ||'dbms_sql.column_value('||
374: to_char(p_cursor)||','||
375: to_char(sel_idx)||','||
376: Rep_Columns(idx).placeholder_name||');
377: ';
386:
387: --* bug#3266462, rravunny
388: If c is null then
389: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is defined for first time');
390: c := dbms_sql.open_cursor;
391: dbms_sql.parse(c, buffer, dbms_sql.native);
392: else
393: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is already defined');
394: End If;
387: --* bug#3266462, rravunny
388: If c is null then
389: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is defined for first time');
390: c := dbms_sql.open_cursor;
391: dbms_sql.parse(c, buffer, dbms_sql.native);
392: else
393: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is already defined');
394: End If;
395: rows := dbms_sql.execute(c);
391: dbms_sql.parse(c, buffer, dbms_sql.native);
392: else
393: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is already defined');
394: End If;
395: rows := dbms_sql.execute(c);
396: --* bug#3266462, rravunny dbms_sql.close_cursor(c);
397:
398: IF (g_print_debug) THEN
399: fa_rx_util_pkg.debug('fa_rx_util_pkg.column_values()-');
392: else
393: fa_rx_util_pkg.debug('cursor cursor_column_values/ c is already defined');
394: End If;
395: rows := dbms_sql.execute(c);
396: --* bug#3266462, rravunny dbms_sql.close_cursor(c);
397:
398: IF (g_print_debug) THEN
399: fa_rx_util_pkg.debug('fa_rx_util_pkg.column_values()-');
400: END IF;
491: declare
492: c integer;
493: rows integer;
494: begin
495: c := dbms_sql.open_cursor;
496: --* bug#3207863, rravunny dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = '||to_char(p_request_id), dbms_sql.native);
497: dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = :request_id', dbms_sql.native); --* bug#3207863, rravunny
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
492: c integer;
493: rows integer;
494: begin
495: c := dbms_sql.open_cursor;
496: --* bug#3207863, rravunny dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = '||to_char(p_request_id), dbms_sql.native);
497: dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = :request_id', dbms_sql.native); --* bug#3207863, rravunny
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
500:
493: rows integer;
494: begin
495: c := dbms_sql.open_cursor;
496: --* bug#3207863, rravunny dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = '||to_char(p_request_id), dbms_sql.native);
497: dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = :request_id', dbms_sql.native); --* bug#3207863, rravunny
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
500:
501: IF (g_print_debug) THEN
494: begin
495: c := dbms_sql.open_cursor;
496: --* bug#3207863, rravunny dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = '||to_char(p_request_id), dbms_sql.native);
497: dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = :request_id', dbms_sql.native); --* bug#3207863, rravunny
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
500:
501: IF (g_print_debug) THEN
502: fa_rx_util_pkg.debug('init_request: ' || to_char(dbms_sql.last_row_count)||' row(s) deleted from table '||Interface_Table);
495: c := dbms_sql.open_cursor;
496: --* bug#3207863, rravunny dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = '||to_char(p_request_id), dbms_sql.native);
497: dbms_sql.parse(c, 'delete from '||Interface_Table||' where request_id = :request_id', dbms_sql.native); --* bug#3207863, rravunny
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
500:
501: IF (g_print_debug) THEN
502: fa_rx_util_pkg.debug('init_request: ' || to_char(dbms_sql.last_row_count)||' row(s) deleted from table '||Interface_Table);
503: END IF;
498: DBMS_SQL.BIND_VARIABLE(c,':request_id',p_request_id); --* bug#3207863, rravunny
499: rows := dbms_sql.execute(c);
500:
501: IF (g_print_debug) THEN
502: fa_rx_util_pkg.debug('init_request: ' || to_char(dbms_sql.last_row_count)||' row(s) deleted from table '||Interface_Table);
503: END IF;
504: dbms_sql.close_cursor(c);
505: end;
506:
500:
501: IF (g_print_debug) THEN
502: fa_rx_util_pkg.debug('init_request: ' || to_char(dbms_sql.last_row_count)||' row(s) deleted from table '||Interface_Table);
503: END IF;
504: dbms_sql.close_cursor(c);
505: end;
506:
507: IF (g_print_debug) THEN
508: fa_rx_util_pkg.debug('init_request: ' || 'Using RX Interface Table = '||Interface_Table);
713: -- should not use any host variables.
714: -- The bind event must pass the host variable :CURSOR_SELECT.
715: -- This variable should be of type number or integer and you
716: -- should use this value as the cursor you pass to
717: -- dbms_sql.bind_variable().
718: --
719: -- Logic Flow
720: -- Blocks marked with a (*) are the events that are being set
721: -- by this procedure.
782: -- The bind event is called once after the select statement is
783: -- built and it has been parsed. You will be passed the value
784: -- of the cursor for the SELECT statement in a host variable
785: -- by the name of :CURSOR_SELECT. You will need to call
786: -- dbms_sql.bind_variabe to bind any variables that you may
787: -- have included in your Where_Clause, Group_By_Clause,
788: -- Having_Clause, or Order_By_Clause.
789: --
790: -- After Fetch
935: IF (g_print_debug) THEN
936: fa_rx_util_pkg.debug('run_report: ' || 'Before Report = '''||Report(idx).before_report||'''');
937: END IF;
938: if Report(idx).before_report is not null then
939: cursor_before_report := dbms_sql.open_cursor;
940: dbms_sql.parse(cursor_before_report,
941: 'BEGIN '||Report(idx).before_report||' END;',
942: dbms_sql.native);
943: rows := dbms_sql.execute(cursor_before_report);
936: fa_rx_util_pkg.debug('run_report: ' || 'Before Report = '''||Report(idx).before_report||'''');
937: END IF;
938: if Report(idx).before_report is not null then
939: cursor_before_report := dbms_sql.open_cursor;
940: dbms_sql.parse(cursor_before_report,
941: 'BEGIN '||Report(idx).before_report||' END;',
942: dbms_sql.native);
943: rows := dbms_sql.execute(cursor_before_report);
944: dbms_sql.close_cursor(cursor_before_report);
938: if Report(idx).before_report is not null then
939: cursor_before_report := dbms_sql.open_cursor;
940: dbms_sql.parse(cursor_before_report,
941: 'BEGIN '||Report(idx).before_report||' END;',
942: dbms_sql.native);
943: rows := dbms_sql.execute(cursor_before_report);
944: dbms_sql.close_cursor(cursor_before_report);
945: end if;
946:
939: cursor_before_report := dbms_sql.open_cursor;
940: dbms_sql.parse(cursor_before_report,
941: 'BEGIN '||Report(idx).before_report||' END;',
942: dbms_sql.native);
943: rows := dbms_sql.execute(cursor_before_report);
944: dbms_sql.close_cursor(cursor_before_report);
945: end if;
946:
947:
940: dbms_sql.parse(cursor_before_report,
941: 'BEGIN '||Report(idx).before_report||' END;',
942: dbms_sql.native);
943: rows := dbms_sql.execute(cursor_before_report);
944: dbms_sql.close_cursor(cursor_before_report);
945: end if;
946:
947:
948: -- Fetch
945: end if;
946:
947:
948: -- Fetch
949: cursor_select := dbms_sql.open_cursor;
950: dbms_sql.parse(cursor_select,
951: build_select,
952: dbms_sql.native);
953: if Report(idx).bind is not null then
946:
947:
948: -- Fetch
949: cursor_select := dbms_sql.open_cursor;
950: dbms_sql.parse(cursor_select,
951: build_select,
952: dbms_sql.native);
953: if Report(idx).bind is not null then
954: -- Bind variables in the select statement
948: -- Fetch
949: cursor_select := dbms_sql.open_cursor;
950: dbms_sql.parse(cursor_select,
951: build_select,
952: dbms_sql.native);
953: if Report(idx).bind is not null then
954: -- Bind variables in the select statement
955: IF (g_print_debug) THEN
956: fa_rx_util_pkg.debug('run_report: ' || ' Bind...');
955: IF (g_print_debug) THEN
956: fa_rx_util_pkg.debug('run_report: ' || ' Bind...');
957: fa_rx_util_pkg.debug('run_report: ' || Report(idx).bind);
958: END IF;
959: cursor_bind := dbms_sql.open_cursor;
960: dbms_sql.parse(cursor_bind,
961: 'BEGIN '||Report(idx).bind||' END;',
962: dbms_sql.native);
963: dbms_sql.bind_variable(cursor_bind,
956: fa_rx_util_pkg.debug('run_report: ' || ' Bind...');
957: fa_rx_util_pkg.debug('run_report: ' || Report(idx).bind);
958: END IF;
959: cursor_bind := dbms_sql.open_cursor;
960: dbms_sql.parse(cursor_bind,
961: 'BEGIN '||Report(idx).bind||' END;',
962: dbms_sql.native);
963: dbms_sql.bind_variable(cursor_bind,
964: ':CURSOR_SELECT',
958: END IF;
959: cursor_bind := dbms_sql.open_cursor;
960: dbms_sql.parse(cursor_bind,
961: 'BEGIN '||Report(idx).bind||' END;',
962: dbms_sql.native);
963: dbms_sql.bind_variable(cursor_bind,
964: ':CURSOR_SELECT',
965: cursor_select);
966: rows := dbms_sql.execute(cursor_bind);
959: cursor_bind := dbms_sql.open_cursor;
960: dbms_sql.parse(cursor_bind,
961: 'BEGIN '||Report(idx).bind||' END;',
962: dbms_sql.native);
963: dbms_sql.bind_variable(cursor_bind,
964: ':CURSOR_SELECT',
965: cursor_select);
966: rows := dbms_sql.execute(cursor_bind);
967: dbms_sql.close_cursor(cursor_bind);
962: dbms_sql.native);
963: dbms_sql.bind_variable(cursor_bind,
964: ':CURSOR_SELECT',
965: cursor_select);
966: rows := dbms_sql.execute(cursor_bind);
967: dbms_sql.close_cursor(cursor_bind);
968: end if; -- of Bind
969: define_columns(cursor_select);
970:
963: dbms_sql.bind_variable(cursor_bind,
964: ':CURSOR_SELECT',
965: cursor_select);
966: rows := dbms_sql.execute(cursor_bind);
967: dbms_sql.close_cursor(cursor_bind);
968: end if; -- of Bind
969: define_columns(cursor_select);
970:
971: IF (g_print_debug) THEN
970:
971: IF (g_print_debug) THEN
972: fa_rx_util_pkg.debug('run_report: ' || 'Executing SELECT statement');
973: END IF;
974: rows := dbms_sql.execute(cursor_select);
975:
976: IF (g_print_debug) THEN
977: fa_rx_util_pkg.debug('run_report: ' || 'Building INSERT');
978: END IF;
975:
976: IF (g_print_debug) THEN
977: fa_rx_util_pkg.debug('run_report: ' || 'Building INSERT');
978: END IF;
979: cursor_insert := dbms_sql.open_cursor;
980: dbms_sql.parse(cursor_insert, build_insert, dbms_sql.native);
981:
982: IF (g_print_debug) THEN
983: fa_rx_util_pkg.debug('run_report: ' || 'After Fetch Initialization');
976: IF (g_print_debug) THEN
977: fa_rx_util_pkg.debug('run_report: ' || 'Building INSERT');
978: END IF;
979: cursor_insert := dbms_sql.open_cursor;
980: dbms_sql.parse(cursor_insert, build_insert, dbms_sql.native);
981:
982: IF (g_print_debug) THEN
983: fa_rx_util_pkg.debug('run_report: ' || 'After Fetch Initialization');
984: END IF;
982: IF (g_print_debug) THEN
983: fa_rx_util_pkg.debug('run_report: ' || 'After Fetch Initialization');
984: END IF;
985: if Report(idx).after_fetch is not null then
986: cursor_after_fetch := dbms_sql.open_cursor;
987: dbms_sql.parse(cursor_after_fetch,
988: 'BEGIN '||Report(idx).after_fetch||' END;',
989: dbms_sql.native);
990: else
983: fa_rx_util_pkg.debug('run_report: ' || 'After Fetch Initialization');
984: END IF;
985: if Report(idx).after_fetch is not null then
986: cursor_after_fetch := dbms_sql.open_cursor;
987: dbms_sql.parse(cursor_after_fetch,
988: 'BEGIN '||Report(idx).after_fetch||' END;',
989: dbms_sql.native);
990: else
991: cursor_after_fetch := null;
985: if Report(idx).after_fetch is not null then
986: cursor_after_fetch := dbms_sql.open_cursor;
987: dbms_sql.parse(cursor_after_fetch,
988: 'BEGIN '||Report(idx).after_fetch||' END;',
989: dbms_sql.native);
990: else
991: cursor_after_fetch := null;
992: end if;
993:
991: cursor_after_fetch := null;
992: end if;
993:
994: loop
995: rows := dbms_sql.fetch_rows(cursor_select);
996: exit when rows < 1;
997:
998: IF (g_print_debug) THEN
999: fa_rx_util_pkg.debug('run_report: ' || 'Get values ');
1003: IF (g_print_debug) THEN
1004: fa_rx_util_pkg.debug('run_report: ' || 'After Fetch');
1005: END IF;
1006: if cursor_after_fetch is not null then
1007: rows := dbms_sql.execute(cursor_after_fetch);
1008: end if;
1009:
1010: IF (g_print_debug) THEN
1011: fa_rx_util_pkg.debug('run_report: ' || 'Insert Row');
1010: IF (g_print_debug) THEN
1011: fa_rx_util_pkg.debug('run_report: ' || 'Insert Row');
1012: END IF;
1013: bind_insert(cursor_insert);
1014: rows := dbms_sql.execute(cursor_insert);
1015: end loop; -- Fetch
1016: if cursor_after_fetch is not null then
1017: dbms_sql.close_cursor(cursor_after_fetch);
1018: end if;
1013: bind_insert(cursor_insert);
1014: rows := dbms_sql.execute(cursor_insert);
1015: end loop; -- Fetch
1016: if cursor_after_fetch is not null then
1017: dbms_sql.close_cursor(cursor_after_fetch);
1018: end if;
1019: dbms_sql.close_cursor(cursor_insert);
1020: dbms_sql.close_cursor(cursor_select);
1021: if cursor_column_values is not null then
1015: end loop; -- Fetch
1016: if cursor_after_fetch is not null then
1017: dbms_sql.close_cursor(cursor_after_fetch);
1018: end if;
1019: dbms_sql.close_cursor(cursor_insert);
1020: dbms_sql.close_cursor(cursor_select);
1021: if cursor_column_values is not null then
1022: dbms_sql.close_cursor(cursor_column_values);
1023: end if;
1016: if cursor_after_fetch is not null then
1017: dbms_sql.close_cursor(cursor_after_fetch);
1018: end if;
1019: dbms_sql.close_cursor(cursor_insert);
1020: dbms_sql.close_cursor(cursor_select);
1021: if cursor_column_values is not null then
1022: dbms_sql.close_cursor(cursor_column_values);
1023: end if;
1024:
1018: end if;
1019: dbms_sql.close_cursor(cursor_insert);
1020: dbms_sql.close_cursor(cursor_select);
1021: if cursor_column_values is not null then
1022: dbms_sql.close_cursor(cursor_column_values);
1023: end if;
1024:
1025: -- After Report Trigger
1026: IF (g_print_debug) THEN
1026: IF (g_print_debug) THEN
1027: fa_rx_util_pkg.debug('run_report: ' || ' After Report Trigger, Pass #'||to_char(idx));
1028: END IF;
1029: if Report(idx).after_report is not null then
1030: cursor_after_report := dbms_sql.open_cursor;
1031: dbms_sql.parse(cursor_after_report,
1032: 'BEGIN '||Report(idx).after_report||' END;',
1033: dbms_sql.native);
1034: rows := dbms_sql.execute(cursor_after_report);
1027: fa_rx_util_pkg.debug('run_report: ' || ' After Report Trigger, Pass #'||to_char(idx));
1028: END IF;
1029: if Report(idx).after_report is not null then
1030: cursor_after_report := dbms_sql.open_cursor;
1031: dbms_sql.parse(cursor_after_report,
1032: 'BEGIN '||Report(idx).after_report||' END;',
1033: dbms_sql.native);
1034: rows := dbms_sql.execute(cursor_after_report);
1035: dbms_sql.close_cursor(cursor_after_report);
1029: if Report(idx).after_report is not null then
1030: cursor_after_report := dbms_sql.open_cursor;
1031: dbms_sql.parse(cursor_after_report,
1032: 'BEGIN '||Report(idx).after_report||' END;',
1033: dbms_sql.native);
1034: rows := dbms_sql.execute(cursor_after_report);
1035: dbms_sql.close_cursor(cursor_after_report);
1036: end if;
1037:
1030: cursor_after_report := dbms_sql.open_cursor;
1031: dbms_sql.parse(cursor_after_report,
1032: 'BEGIN '||Report(idx).after_report||' END;',
1033: dbms_sql.native);
1034: rows := dbms_sql.execute(cursor_after_report);
1035: dbms_sql.close_cursor(cursor_after_report);
1036: end if;
1037:
1038: <
1031: dbms_sql.parse(cursor_after_report,
1032: 'BEGIN '||Report(idx).after_report||' END;',
1033: dbms_sql.native);
1034: rows := dbms_sql.execute(cursor_after_report);
1035: dbms_sql.close_cursor(cursor_after_report);
1036: end if;
1037:
1038: <
1039: null;
1101: begin
1102: enable_debug;
1103: if not m_dbms_output then
1104: m_dbms_output := true;
1105: m_output_cursor := dbms_sql.open_cursor;
1106: sqlstmt := 'begin dbms_'||'output.enable(:b_size); end;';
1107: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1103: if not m_dbms_output then
1104: m_dbms_output := true;
1105: m_output_cursor := dbms_sql.open_cursor;
1106: sqlstmt := 'begin dbms_'||'output.enable(:b_size); end;';
1107: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1104: m_dbms_output := true;
1105: m_output_cursor := dbms_sql.open_cursor;
1106: sqlstmt := 'begin dbms_'||'output.enable(:b_size); end;';
1107: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1112: m_output_cursor := dbms_sql.open_cursor;
1105: m_output_cursor := dbms_sql.open_cursor;
1106: sqlstmt := 'begin dbms_'||'output.enable(:b_size); end;';
1107: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1112: m_output_cursor := dbms_sql.open_cursor;
1113: sqlstmt := 'begin dbms_'||'output.put_line(:b_msg); end;';
1106: sqlstmt := 'begin dbms_'||'output.enable(:b_size); end;';
1107: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1112: m_output_cursor := dbms_sql.open_cursor;
1113: sqlstmt := 'begin dbms_'||'output.put_line(:b_msg); end;';
1114: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1108: dbms_sql.bind_variable(m_output_cursor, 'b_size', bufsize);
1109: rows := dbms_sql.execute(m_output_cursor);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1112: m_output_cursor := dbms_sql.open_cursor;
1113: sqlstmt := 'begin dbms_'||'output.put_line(:b_msg); end;';
1114: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1115:
1116: -- dbms_output.enable(bufsize);
1110: dbms_sql.close_cursor(m_output_cursor);
1111:
1112: m_output_cursor := dbms_sql.open_cursor;
1113: sqlstmt := 'begin dbms_'||'output.put_line(:b_msg); end;';
1114: dbms_sql.parse(m_output_cursor, sqlstmt, dbms_sql.native);
1115:
1116: -- dbms_output.enable(bufsize);
1117: end if;
1118: end enable_debug;
1139: end if;
1140: m_debug_flag := false;
1141: if m_dbms_output then
1142: m_dbms_output := false;
1143: dbms_sql.close_cursor(m_output_cursor);
1144: end if;
1145: end disable_debug;
1146:
1147: -------------------------------------------------------------------------
1178: BEGIN
1179: maxidx := trunc(lengthb(msg)/255);
1180: for idx in 0..maxidx loop
1181:
1182: dbms_sql.bind_variable(m_output_cursor, 'b_msg', substrb(msg,idx*255+1,255));
1183: rows := dbms_sql.execute(m_output_cursor);
1184: -- dbms_output.put_line(substrb(msg,idx*255+1,255));
1185: end loop;
1186: END dbms_log;
1179: maxidx := trunc(lengthb(msg)/255);
1180: for idx in 0..maxidx loop
1181:
1182: dbms_sql.bind_variable(m_output_cursor, 'b_msg', substrb(msg,idx*255+1,255));
1183: rows := dbms_sql.execute(m_output_cursor);
1184: -- dbms_output.put_line(substrb(msg,idx*255+1,255));
1185: end loop;
1186: END dbms_log;
1187: