View previous topic :: View next topic
|
Author |
Message |
Alice
New User
Joined: 04 Jun 2009 Posts: 4 Location: India
|
|
|
|
I have the option of using DSNUTILB alone for unload.
Is it possible to use SUBSTR function in the WHEN clause of UNLOAD command.
When I enter the following in SYSIN
UNLOAD TABLESPACE <TS Name>
FROM TABLE <Table name>
WHEN ((SUBSTR(<Column Name>,m,n)) = '<value>')
I get the message " INVALID KEYWORD - <column name>" |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
post your sysout and sysprint messages.. |
|
Back to top |
|
|
Alice
New User
Joined: 04 Jun 2009 Posts: 4 Location: India
|
|
|
|
Only Sysprint is available..
DSNU082I DSNUGPRW - INVALID KEYWORD - <Column Name>
DSNU012I DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Try:
WHEN (SUBSTR(<Column Name>,m,n) = '<value>') |
|
Back to top |
|
|
Alice
New User
Joined: 04 Jun 2009 Posts: 4 Location: India
|
|
|
|
I first tried this only. It gave the same error. Thats why I included extra paranthesis. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
try (column_name LIKE ...)
it appears that the predicate options of the WHEN clause are rather restrictive.
I would not be surprised if SUBSTR is not allowed. |
|
Back to top |
|
|
Alice
New User
Joined: 04 Jun 2009 Posts: 4 Location: India
|
|
|
|
Tried with WHEN (SUBSTR(<Column Name>,m,n) LIKE '<value>')
It doesnt work.
The problem might be with the usage of SUBSTR in WHEN clause. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
glad you found your answer. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Alice,
This worked for me,
Code: |
UNLOAD TABLESPACE BOBT1.EMPTS
PUNCHDDN SYSPUNCH UNLDDN SYSREC
FROM TABLE BOBT1.EMPLOYEE
(EMPNO, LASTNAME, SALARY DECIMAL EXTERNAL)
WHEN (EMPNO LIKE ='1001%') |
Are you looking for something like this ?
Thank You,
Sushanth |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I seem to recall that the WHEN clause only allowed basic comparisons and wouldn't let you do functions in the comparison such as SUSBTR etc. I'd have to dig out the documentation and check (or you could do that yourself). |
|
Back to top |
|
|
|