dbTalk Databases Forums  

How to Activate NLI In a Stored Procedure ?

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss How to Activate NLI In a Stored Procedure ? in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fin
 
Posts: n/a

Default How to Activate NLI In a Stored Procedure ? - 09-20-2010 , 01:37 PM






Hey people,

I have a database I use as a stock tracker, with no online users so to
speak so I do NOT have to worry about recovery or rollbacks etc.
Everything is for want of a better word, BATCH run at the end of the
day in a sequence of Stored Procedures.

Now I these several Stored Procedures that must insert x millions
records daily and I am trying to find a way to avoid logging thrashing
the discs.

I have tried to create these stored procedures with activating NLI in
the Procedure itself but for some reason it will fail when creating
the procedure itself. I keep getting the following error:

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "ALTER" was found following "PEN
RID_CURSOR;
". Expected tokens may include: "TRUNCATE". LINE NUMBER=24.
SQLSTATE=42601

The command I am using is :

ALTER TABLE DB2ADMIN.TEST_NLI ACTIVATE NOT LOGGED INITIALLY;

Can anyone please enlighten me as to how this may be done ?

Many thanks, Tim

Reply With Quote
  #2  
Old   
Mark A
 
Posts: n/a

Default Re: How to Activate NLI In a Stored Procedure ? - 09-20-2010 , 02:32 PM






"Fin" <tdavidge (AT) hotmail (DOT) com> wrote

Quote:
Hey people,

I have a database I use as a stock tracker, with no online users so to
speak so I do NOT have to worry about recovery or rollbacks etc.
Everything is for want of a better word, BATCH run at the end of the
day in a sequence of Stored Procedures.

Now I these several Stored Procedures that must insert x millions
records daily and I am trying to find a way to avoid logging thrashing
the discs.

I have tried to create these stored procedures with activating NLI in
the Procedure itself but for some reason it will fail when creating
the procedure itself. I keep getting the following error:

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "ALTER" was found following "PEN
RID_CURSOR;
". Expected tokens may include: "TRUNCATE". LINE NUMBER=24.
SQLSTATE=42601

The command I am using is :

ALTER TABLE DB2ADMIN.TEST_NLI ACTIVATE NOT LOGGED INITIALLY;

Can anyone please enlighten me as to how this may be done ?

Many thanks, Tim
I would recommend that you load the data with Load Command using
nonrecoverable option, then do a set integrity on the table (if necessary).
You can invoke the load command from a SP if you really want to via a system
SP that can invoke some DB2 commands.

Reply With Quote
  #3  
Old   
Fin
 
Posts: n/a

Default Re: How to Activate NLI In a Stored Procedure ? - 09-20-2010 , 04:21 PM



I actually found a way using and old post from Serge.

set txt = cpmmand
and execute immediate txt

Worked just fine, thanks for the response though.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.