|
View previous topic :: View next topic
|
| Author |
Message |
Parinathan
New User
Joined: 29 Apr 2012 Posts: 3 Location: India
|
|
|
|
I receive an Error while trying to execute the below query in BMC unload utility ADUUMAIN
Select * from DB2.VEMPNO_EMP
where EFF_DT >= (select current_date from sysibm.sysdummy1)
The error msg is below,
Unexpected token near
*
(Select
Does BMC unload not support sub query?
Advance thanks for your reply  |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
current_date
as is current_time
and current_timestamp
are Special Registers
and can be referenced directly (without the sysibm.sysdumm1).
and obviously, insure that EFF_DT is of date char type.
now, whether BMC supports sub-queries, I don't know.
you are going to have to look at the documentation.
I do know that your sql can be improved,
and you don't need the sub-query in this instance. |
|
| Back to top |
|
 |
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
BMC Unload plus supports sub-query if DIRECT NO is specified.
The below are the quotes from the manual.
| Quote: |
DIRECT NO supports the full range of DB2 SQL SELECT functionality and view definitions.
If you specify DIRECT NO, UNLOAD PLUS uses DB2 dynamic SQL to process the SELECT statement and read the table data. You can take advantage of the full range of functionality that the DB2 SQL SELECT statement provides. However, DIRECT NO is not a high-performance solution for unloading large volumes of data.
UNLOAD PLUS does not support the SHRLEVEL option when you specify DIRECT NO. Instead, you can use isolation levels, which are available in the DB2 SQL WITH clause, to control access to objects during the unload process. For example, to allow read-only access to the objects while using DIRECT NO, you can specify WITH RR in the SELECT statement.
However, specifying an isolation level might not result in the level of locking that SHRLEVEL REFERENCE achieves. The access path that UNLOAD PLUS uses when processing the SELECT statement can affect row locking. Rows might be locked as they are read, whereas specifying SHRLEVEL REFERENCE causes UNLOAD PLUS to lock the objects before it reads the data.
When you use DIRECT NO, you must specify the primary and secondary SPACE quantities.
Additionally, DIRECT NO does not support all options, including the
following examples:
- unloading from image copies
- user-defined types
- UNLOAD TABLESPACE command
- SHRLEVEL option
|
|
|
| Back to top |
|
 |
Parinathan
New User
Joined: 29 Apr 2012 Posts: 3 Location: India
|
|
|
|
Thank you... It works |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| Parinathan wrote: |
Thank you... It works |
thx for getting back to us, but what did you do to resolve your problem? |
|
| Back to top |
|
 |
Parinathan
New User
Joined: 29 Apr 2012 Posts: 3 Location: India
|
|
|
|
| I removed the SHRLEVEL clause and added DIRECT NO. It worked. I can't directly use CURRENT DATE since i have to add additional manipulations with CURRENT DATE |
|
| Back to top |
|
 |
|
|