Select wonum.....
WHERE......
I need to be able to do this as I have several processess that are similar....
I do not want to just modify the main sql....
MINSQL="SELECT NVL(MAX(TO_NUMBER(last_rowstamp)),0) FROM esmaximo.wdw_incr_rowstamp_pull
WHERE table_name = 'WOSTATUS' AND pull_status = 'C'"
MINRS=
MAXSQL="SELECT esmaximo.maxseq.nextval FROM dual"
MAXRS=
#MAIN SQL...
sqlplus esmaxbat/imagine >${ERRTMP} 2>&1 <<-sulplqs
spool /var/opt/oracle/mp4/maximart/wostatus.dat;
set linesize 110
select WONUM||'|'||
STATUS||'|'||
to_char(CHANGEDATE, 'yyyy-mm-dd hh24:mi')||'|'||
CHANGEBY||'|'||
MEMO||'|'||
GLACCOUNT||'|'||
FINCNTRLID||'|'||
ROWSTAMP
from WOSTATUS
WHERE TO_NUMBER(rowstamp) BETWEEN ${MINRS} AND ${MAXRS};
spool off;
WHERE......
I need to be able to do this as I have several processess that are similar....
I do not want to just modify the main sql....
MINSQL="SELECT NVL(MAX(TO_NUMBER(last_rowstamp)),0) FROM esmaximo.wdw_incr_rowstamp_pull
WHERE table_name = 'WOSTATUS' AND pull_status = 'C'"
MINRS=
MAXSQL="SELECT esmaximo.maxseq.nextval FROM dual"
MAXRS=
#MAIN SQL...
sqlplus esmaxbat/imagine >${ERRTMP} 2>&1 <<-sulplqs
spool /var/opt/oracle/mp4/maximart/wostatus.dat;
set linesize 110
select WONUM||'|'||
STATUS||'|'||
to_char(CHANGEDATE, 'yyyy-mm-dd hh24:mi')||'|'||
CHANGEBY||'|'||
MEMO||'|'||
GLACCOUNT||'|'||
FINCNTRLID||'|'||
ROWSTAMP
from WOSTATUS
WHERE TO_NUMBER(rowstamp) BETWEEN ${MINRS} AND ${MAXRS};
spool off;