472,782 Members | 1,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

AS400 STRSQL vs RUNSQLSTM

I've worked with DB2 for a long time, but I'm new to the AS400
environment.
I'm having a problem with an SQL statement that runs perfectly when I
use STRSQL, but when I batch it and call RUNSQLSTM, the exact same
statement (with a semicolon added at the very end) fails with the
following error:

Buffer length longer than record for member SBXARDTL.
Member SBXARDTL not journaled to journal *N.
SBXARDTL in QGPL not valid for operation.
RUNSQLSTM command failed.
SQL9010 received by procedure SBXORCEXT.

Now, SBXARDTL is a new table I created, and the SQL statement is an
insert based on a select on another table. Table was empty when I
attempted the batch insert.
SBXORCEXT is the CL program that calls RUNSQLSTM.

I could add more details, but for a seasoned AS400 expert among you
probably this is enough info to pinpoint the problem.

I will appreciate any hints.
Thanks in advance.
Jun 27 '08 #1
2 18384
Eniacson wrote:
I've worked with DB2 for a long time, but I'm new to the AS400
environment.
I'm having a problem with an SQL statement that runs perfectly when I
use STRSQL, but when I batch it and call RUNSQLSTM, the exact same
statement (with a semicolon added at the very end) fails with the
following error:

Buffer length longer than record for member SBXARDTL.
Member SBXARDTL not journaled to journal *N.
SBXARDTL in QGPL not valid for operation.
RUNSQLSTM command failed.
SQL9010 received by procedure SBXORCEXT.

Now, SBXARDTL is a new table I created, and the SQL statement is an
insert based on a select on another table. Table was empty when I
attempted the batch insert.
SBXORCEXT is the CL program that calls RUNSQLSTM.

I could add more details, but for a seasoned AS400 expert among you
probably this is enough info to pinpoint the problem.

I will appreciate any hints.
Thanks in advance.
DB2 for i5/OS supports an isolation level of no-commit (NC). This means
SQL can be run in a mode where a transaction can not be committed or
rolled back. For NC, no journaling is required, whereas it is required
for all other isolation levels. The "... not valid for operation."
message is likely SQL7008 with reason code 3 (see below). You might
compare the isolation level (aka commitment control level) used in both
STRSQL and RUNSQLSTM. In STRSQL use F13 option 1 to check if commitment
control is *NONE; then check the value for the COMMIT parameter of
RUNSQLSTM (default is *CHG I believe). If this is the problem and the
RUNSQLSTM default is other than *NONE, you could change it to *NONE, or
set up journaling for the target table (physical file).
http://publib.boulder.ibm.com/infoce...v5r4/index.jsp

Note that when using SQL CREATE SCHEMA, journal objects are
automatically created. Then when an SQL table is created into the
schema, it is automatically journaled.

http://publib.boulder.ibm.com/infoce...rbafyjourg.htm

Message ID . . . . . . . . . : SQL7008

Message file . . . . . . . . : QSQLMSG

Library . . . . . . . . . : QSYS

Message . . . . : &1 in &2 not valid for operation.

Cause . . . . . : The reason code is &3. Reason codes are:

1 -- &1 has no members.

2 -- &1 has been saved with storage free.

3 -- &1 not journaled, no authority to the journal, or the journal
state
is *STANDBY. Files with an RI constraint action of CASCADE, SET NULL,
or
SET DEFAULT must be journaled to the same journal.
--
Karl Hanson
Jun 27 '08 #2
On May 15, 2:38*pm, Karl Hanson <kchan...@youess.ibm.comwrote:
Eniacson wrote:
I've worked with DB2 for a long time, but I'm new to the AS400
environment.
I'm having a problem with an SQL statement that runs perfectly when I
use STRSQL, but when I batch it and call RUNSQLSTM, the exact same
statement (with a semicolon added at the very end) fails with the
following error:
Buffer length longer than record for member SBXARDTL.
Member SBXARDTL not journaled to journal *N.
SBXARDTL in QGPL not valid for operation.
RUNSQLSTM command failed.
SQL9010 received by procedure SBXORCEXT.
Now, SBXARDTL is a new table I created, and the SQL statement is an
insert based on a select on another table. Table was empty when I
attempted the batch insert.
SBXORCEXT is the CL program that calls RUNSQLSTM.
I could add more details, but for a seasoned AS400 expert among you
probably this is enough info to pinpoint the problem.
I will appreciate any hints.
Thanks in advance.

DB2 for i5/OS supports an isolation level of no-commit (NC). This means
SQL can be run in a mode where a transaction can not be committed or
rolled back. For NC, no journaling is required, whereas it is required
for all other isolation levels. The "... not valid for operation."
message is likely SQL7008 with reason code 3 (see below). *You might
compare the isolation level (aka commitment control level) used in both
STRSQL and RUNSQLSTM. In STRSQL use F13 option 1 to check if commitment
control is *NONE; then check the value for the COMMIT parameter of
RUNSQLSTM (default is *CHG I believe). If this is the problem and the
RUNSQLSTM default is other than *NONE, you could change it to *NONE, or
set up journaling for the target table (physical file).http://publib.boulder.ibm.com/infoce...v5r4/index.jsp

Note that when using SQL CREATE SCHEMA, journal objects are
automatically created. Then when an SQL table is created into the
schema, it is automatically journaled.

http://publib.boulder.ibm.com/infoce...ndex.jsp?topic...

Message ID . . . . . . . . . : * SQL7008

Message file . . . . . . . . : * QSQLMSG

* *Library *. . . . . . . . . : * * QSYS

Message . . . . : * &1 in &2 not valid for operation.

Cause . . . . . : * The reason code is &3. *Reason codes are:

* * *1 -- &1 has no members.

* * *2 -- &1 has been saved with storage free.

* * *3 -- &1 not journaled, no authority to the journal, or the journal
state
* *is *STANDBY. *Files with an RI constraint action of CASCADE, SET NULL,
or
* *SET DEFAULT must be journaled to the same journal.

--
Karl Hanson- Hide quoted text -

- Show quoted text -
You were right on the mark.
Modifying the CL was problematic due to the change control policies in
place.
Instead I followed the links you provided and found out that adding
the statement below to my sql would override the default for
RUNSQLSTM:
SET TRANSACTION ISOLATION LEVEL NO COMMIT
The job completed successfully after that change.
Thank you!
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: fn | last post by:
Can anyone help me understand what it takes to define a Linked Server connection to an IBM eSeries (AS400)? Do I need Microsoft's SNA Server or some other product or can I simply do it with the...
2
by: Niyazi | last post by:
Hi, Our company uses IBM AS400 and DB2 (version 4.5 I guess). I have to do some report but I donot know how to access the AS400 DB2. I search IBM unfortunately IBM site in mess. Can anyone tell...
2
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400...
0
by: CompDude | last post by:
Hi All I am trying to copy data from DB2 to SQL server using SQL Data Tranformation Services. I am able to do that by supplying AS400 username/password along with the iSeries DSN Name, at the...
0
by: alan_sec | last post by:
Hi. Does the com.ibm.as400.access.AS400JDBCDriver driver that is part of JTOpen (http://jt400.sourceforge.net) works with db2 udb version 7 that is installed on windows 2000? I' m trying to...
13
by: Sehboo | last post by:
Hello, we have data sitting on AS400 (V4R5M0) - DB2-400. I need to access that from my vb.net application. I don't know anything about AS400. Is it possible to get data from tables and stored...
6
by: MadMan2004 | last post by:
Hello all! I'm having a problem with a project I'm working on and I'd like to ask for anyone's input that might be helpful. I'm building a rather large front-end application connecting to an...
1
by: Iain | last post by:
Hi All I am creating a database trigger to write details real time from tables on one AS400 to another over our WAN. Is there such a concept as ODBC connections on the AS400 to perform this...
1
by: accyboy1981 | last post by:
Hi, I'm new to AS400 and am trying to copy the contents of a table from an SQL Server 2000 table to a table in AS400, I'm doing this using DTS. I'm connecting using the iSeries Access ODBC...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.