Oracle command in Datastage Sequence
Posted: Thu Apr 17, 2014 3:33 am
Hello everyone,
I have this Oracle SELECT command which calculates the maximum value of a column and adds a 1 to it. I would like to call this in a Datastage Sequence job which I managed to do by first creating a .sql file containing the command.
My problem is however in filtering just the result and using the same. In the Datastage Director log I see:
Reply=0
Output from command ====>
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 17 10:30:33 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
old 1: SELECT NVL(MAX(NUM_ITERATION),0)+1 AS ITE FROM TABLE WHERE PERD_ARRT_INFO = '&1'
new 1: SELECT NVL(MAX(NUM_ITERATION),0)+1 AS ITE FROM TABLE WHERE PERD_ARRT_INFO = '201309'
ITE
----------
2
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
What I need is just the value 2
Anyone know of a function to do this?
I have done this in IBM DB2 and thus have EReplace and Convert functions in place but the same stubbornly refuses to work for Oracle and returns a lot of text.
Thanks guys
Tony
I have this Oracle SELECT command which calculates the maximum value of a column and adds a 1 to it. I would like to call this in a Datastage Sequence job which I managed to do by first creating a .sql file containing the command.
My problem is however in filtering just the result and using the same. In the Datastage Director log I see:
Reply=0
Output from command ====>
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 17 10:30:33 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
old 1: SELECT NVL(MAX(NUM_ITERATION),0)+1 AS ITE FROM TABLE WHERE PERD_ARRT_INFO = '&1'
new 1: SELECT NVL(MAX(NUM_ITERATION),0)+1 AS ITE FROM TABLE WHERE PERD_ARRT_INFO = '201309'
ITE
----------
2
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
What I need is just the value 2
Anyone know of a function to do this?
I have done this in IBM DB2 and thus have EReplace and Convert functions in place but the same stubbornly refuses to work for Oracle and returns a lot of text.
Thanks guys
Tony