88: end get_seq_name;
89:
90: /*
91: * This function gets the nextval for a db sequence given the seq name.
92: * Fix Bug 1073084 - changed to use EXECUTE IMMEDIATE instead of dbms_sql.
93: */
94: function get_next_auto_seq (dbseqnm in varchar2) return number
95: is
96: v_proc_stmt varchar2(100);
163: 10,'DD-MM-YYYY',
164: 11,'DD-MON-YYYY',
165: 'YYYY/MM/DD')) +.9999);
166:
167: c := dbms_sql.open_cursor;
168:
169: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
170: 'into :next_val from sys.dual; end;';
171:
168:
169: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
170: 'into :next_val from sys.dual; end;';
171:
172: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
173: dbms_sql.bind_variable(c, 'next_val', next_val);
174:
175: row_processed := dbms_sql.execute(c);
176: dbms_sql.variable_value(c,'next_val', val);
169: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
170: 'into :next_val from sys.dual; end;';
171:
172: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
173: dbms_sql.bind_variable(c, 'next_val', next_val);
174:
175: row_processed := dbms_sql.execute(c);
176: dbms_sql.variable_value(c,'next_val', val);
177:
171:
172: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
173: dbms_sql.bind_variable(c, 'next_val', next_val);
174:
175: row_processed := dbms_sql.execute(c);
176: dbms_sql.variable_value(c,'next_val', val);
177:
178: dbms_sql.close_cursor(c);
179: return (val);
172: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
173: dbms_sql.bind_variable(c, 'next_val', next_val);
174:
175: row_processed := dbms_sql.execute(c);
176: dbms_sql.variable_value(c,'next_val', val);
177:
178: dbms_sql.close_cursor(c);
179: return (val);
180:
174:
175: row_processed := dbms_sql.execute(c);
176: dbms_sql.variable_value(c,'next_val', val);
177:
178: dbms_sql.close_cursor(c);
179: return (val);
180:
181: exception
182: when NO_DATA_FOUND then
213: /* bug 1019289, 1295363 - change between to add .9999 to end date also removed trunc
214: and date coversion routines not needed since this trx_date is a date */
215: AND trx_date between sa.start_date and nvl(sa.end_date + .9999, trx_date + .9999);
216:
217: c := dbms_sql.open_cursor;
218:
219: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
220: 'into :next_val from sys.dual; end;';
221:
218:
219: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
220: 'into :next_val from sys.dual; end;';
221:
222: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
223: dbms_sql.bind_variable(c, 'next_val', next_val);
224:
225: row_processed := dbms_sql.execute(c);
226: dbms_sql.variable_value(c,'next_val', val);
219: proc_stmt := 'begin select ' || dbseqnm || '.nextval ' ||
220: 'into :next_val from sys.dual; end;';
221:
222: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
223: dbms_sql.bind_variable(c, 'next_val', next_val);
224:
225: row_processed := dbms_sql.execute(c);
226: dbms_sql.variable_value(c,'next_val', val);
227:
221:
222: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
223: dbms_sql.bind_variable(c, 'next_val', next_val);
224:
225: row_processed := dbms_sql.execute(c);
226: dbms_sql.variable_value(c,'next_val', val);
227:
228: dbms_sql.close_cursor(c);
229: return (val);
222: dbms_sql.parse(c, proc_stmt, dbms_sql.native);
223: dbms_sql.bind_variable(c, 'next_val', next_val);
224:
225: row_processed := dbms_sql.execute(c);
226: dbms_sql.variable_value(c,'next_val', val);
227:
228: dbms_sql.close_cursor(c);
229: return (val);
230:
224:
225: row_processed := dbms_sql.execute(c);
226: dbms_sql.variable_value(c,'next_val', val);
227:
228: dbms_sql.close_cursor(c);
229: return (val);
230:
231: exception
232: when NO_DATA_FOUND then
584: end get_seq_info;
585:
586: /*
587: * This finction creates an audit record in the audit table for the current DocSeq
588: * Fix Bug 1073084 - changed to use EXECUTE IMMEDIATE instead of dbms_sql.
589: */
590: function create_audit_rec ( aud_tab_name in varchar2,
591: docseq_id in number,
592: seq_val in number,