Q
Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Scheduling a SQL update statement

One user writes, "I need to run a SQL Update statement after hours, and it would be nice to schedule it. I saw your posting about the RUNSQLSTM command, but I've had no success with it. I tried saving my command in the STRSQL run, which it saved to a QSQLSESS file, but I still could not use that in the RUNSQLSTM. I need a way to do a STRSQL in a SBMJOB command or through JOBSCHE." DB2 expert Kent Milligan provides a few possible reasons that the command isn't working.

I need to run a SQL update statement after hours, and it would be nice to schedule it. I saw your posting about the RUNSQLSTM command, but I've had no success with it. I tried saving my command in the STRSQL run, which it saved to a QSQLSESS file, but I still could not use that in the RUNSQLSTM. I need a way to do a STRSQL in a SBMJOB command or through JOBSCHE.
If you can run the RUNSQLSTM command interactively, there is no reason you can't issue it from SBMJOB command or the job scheduler.

Here a couple of things to look for:

1. If you are not journaling the file that is being updated, make sure you specify COMMIT(*NONE).

2. Make sure the statement syntax is correct.

If it is not working, the spool file generated when running the RUNSQLSTM command (which will have the same name as the source file member that contains the SQL statements), should provide insight as to why it is failing.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

Visit the ITKnowledge Exchange and get answers to your DB2 questions fast.

Check out this Search400.com Featured Topic: Expert advice on DB2

Search400.com's targeted search engine: Get relevant information on DB2/400.

The Best Web Links: Tips, tutorials and more.

Dig Deeper on DB2 UDB (universal databases)

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close