set showmode off echo off set heading off pagesize 0 timing off feedback off linesize 80 rem rem Script: uncomplete.sql rem Purpose: Reset document status indicators to incomplete (for rem document types F and J (fgbjvch_status_ind), E (fgbench_status), rem and I (fabinvh_complete_ind), to fix errant documents. rem Note: The document can't be in fobappd, fgbtrnd, or fgbtrnh (which rem are checked here). rem rem Author: Stephen Rea rem Released: 10/8/99 rem rem Updates: rem 6/15/00 - Output count of records changed. rem 7/7/00 - Comment out commit statement. rem accept docnum char prompt 'Enter document number to uncomplete: ' set termout off verify off spool fd_do.sql select 'define docnum = ' || upper('&docnum') from dual; spool off @fd_do.sql spool fd_do.sql select '!echo Document &docnum found in fgbtrnh - can\''t uncomplete' || chr(10) || '/*' from dual where exists (select 'x' from fgbtrnh where fgbtrnh_doc_code = '&docnum'); spool off @fd_do.sql spool fd_do.sql select '!echo Document &docnum found in fgbtrnd - can\''t uncomplete' || chr(10) || '/*' from dual where exists (select 'x' from fgbtrnd where fgbtrnd_doc_code = '&docnum'); spool off @fd_do.sql spool fd_do.sql select '!echo "Document &docnum found in fobappd (use fixdoc.sql instead)"' || chr(10) || '/*' from dual where exists (select 'x' from fobappd where fobappd_doc_num = '&docnum'); spool off @fd_do.sql spool fd_do.sql select 'update fgbjvch set fgbjvch_status_ind = ''I'' where' || chr(10) || 'fgbjvch_doc_num = ''&docnum'' and fgbjvch_status_ind != ''I'';' from dual where substr('&docnum',1,1) in ('F','J'); select 'update fgbench set fgbench_status = ''I'' where' || chr(10) || 'fgbench_num = ''&docnum'' and fgbench_status != ''I'';' from dual where substr('&docnum',1,1) = 'E'; select 'update fabinvh set fabinvh_complete_ind = ''N'' where' || chr(10) || 'fabinvh_code = ''&docnum'' and fabinvh_complete_ind != ''N'';' from dual where substr('&docnum',1,1) = 'I'; spool off !echo !cat fd_do.sql set termout on feedback 1 @fd_do.sql set termout off rem commit; !echo Note: commit if OK. !rm fd_do.sql */ set pagesize 24 linesize 80 set heading on termout on set timing on feedback 6 verify on echo on showmode both