473,796 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL stmt to find if table is in load pending state?

How can i find the load state of the table using SQL, i can do "load
query table tablename" but i cannot execute this as a sql statement.
What i want to do is, i m using a java stored priocedure to load a
table, now after loading, i want to make sure load completed
successfully by checking the state of the table
like
if(tablestate.e quals("N"))
{proceed forward}
else
break here..
Any suggestions are welcome...
PS
Pierre, since u have answered my previous 2 questions , I assume you ar
egoing to do for this one too..:-)

Apr 12 '06 #1
10 5025
Check this in SYSTEM MONITOR GUIDE

tablespace_stat e_change_object _id - State Change Object Identification
monitor element
Cheers...
Shashi Mannepalli
technocrat wrote:
How can i find the load state of the table using SQL, i can do "load
query table tablename" but i cannot execute this as a sql statement.
What i want to do is, i m using a java stored priocedure to load a
table, now after loading, i want to make sure load completed
successfully by checking the state of the table
like
if(tablestate.e quals("N"))
{proceed forward}
else
break here..
Any suggestions are welcome...
PS
Pierre, since u have answered my previous 2 questions , I assume you ar
egoing to do for this one too..:-)


Apr 12 '06 #2
Do a Google search on: db2 and snapshot table fubnctions
You get to:
http://publib.boulder.ibm.com/infoce...n/t0010418.htm
The URL may have wrapped in this answer.

Look at the SNAPSHOT_TBS function. it returns, amongst other things, the
state of the tblsp.
Given it's a table function, you can use it as SQL.
HTH, Pierre.
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"technocrat " <su************ @gmail.com> a écrit dans le message de news:
11************* *********@j33g2 00...legr oups.com...
How can i find the load state of the table using SQL, i can do "load
query table tablename" but i cannot execute this as a sql statement.
What i want to do is, i m using a java stored priocedure to load a
table, now after loading, i want to make sure load completed
successfully by checking the state of the table
like
if(tablestate.e quals("N"))
{proceed forward}
else
break here..
Any suggestions are welcome...
PS
Pierre, since u have answered my previous 2 questions , I assume you ar
egoing to do for this one too..:-)


Apr 13 '06 #3
OOOPS!
My apologies but the snapshot_tbs table function will not return the table
space state.
Mes excuses, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"technocrat " <su************ @gmail.com> a écrit dans le message de news:
11************* *********@j33g2 00...legr oups.com...
How can i find the load state of the table using SQL, i can do "load
query table tablename" but i cannot execute this as a sql statement.
What i want to do is, i m using a java stored priocedure to load a
table, now after loading, i want to make sure load completed
successfully by checking the state of the table
like
if(tablestate.e quals("N"))
{proceed forward}
else
break here..
Any suggestions are welcome...
PS
Pierre, since u have answered my previous 2 questions , I assume you ar
egoing to do for this one too..:-)


Apr 13 '06 #4
i am actually trying to use the sysproc.db2load as a callable statement
and it returns some 6 OUT parameters...on e of them is sqlerrorcode... .
how can i actually access the value of that paramenter...li ke ..the
value of the 4th OUT parameter of the callable statemet...
any help appreciated..!

Apr 14 '06 #5
ok i figured out the above one but now my doubt is once the load failed
i want to run the load with terminate command. so i will be calling
CREATE PROCEDURE SYSPROC.DB2LOAD
so in the above callable statement what would be the secnd parameter (
the select cusor ) because my load st will be "load from /dev/null of
del terminate into control.ACCOUNT nonrecoverable" so there is no
select statement, how would i do this???/?

Apr 14 '06 #6
Correct me if i am wrong.

Just using:
select tabname, status from syscat.tables where tabname=' xxx',
from status, you can tell what state the table is.
Mike

technocrat wrote:
ok i figured out the above one but now my doubt is once the load failed
i want to run the load with terminate command. so i will be calling
CREATE PROCEDURE SYSPROC.DB2LOAD
so in the above callable statement what would be the secnd parameter (
the select cusor ) because my load st will be "load from /dev/null of
del terminate into control.ACCOUNT nonrecoverable" so there is no
select statement, how would i do this???/?


Apr 14 '06 #7
mike_li wrote:
Correct me if i am wrong.

Just using:
select tabname, status from syscat.tables where tabname=' xxx',
from status, you can tell what state the table is.
Mike

technocrat wrote:
ok i figured out the above one but now my doubt is once the load failed
i want to run the load with terminate command. so i will be calling
CREATE PROCEDURE SYSPROC.DB2LOAD
so in the above callable statement what would be the secnd parameter (
the select cusor ) because my load st will be "load from /dev/null of
del terminate into control.ACCOUNT nonrecoverable" so there is no
select statement, how would i do this???/?


Unfortunately no ... the status field indicates the check pending status
and is not related to the LOAD status:
The check pending status of the object:

* N = Normal table, view, alias or nickname
* C = Check pending on table or nickname
* X = Inoperative view or nickname
Bob
Apr 14 '06 #8
Pierre Saint-Jacques wrote:
OOOPS!
My apologies but the snapshot_tbs table function will not return the
table space state.
Mes excuses, Pierre.

Pierre - It seems the snapshot_tbs_cf g table function is what you want here?
Apr 14 '06 #9
So finally whats the solution????? snapshot _tbs_cfg? I have no idea
how that should be implemented..an y suggestons..I will google also...

Apr 14 '06 #10

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

Similar topics

1
8541
by: R. Clausen | last post by:
During the night we replicate multiple tables from a production database to a test database. Due to a server disk space full condition occurring while replication was running, a tablespace was left in 'Load Pending' status. This tablespace has about 20 tables in it. I ran the load/terminate command and have now come to understand that the message 'SQL3508N Error in accessing a file or path of type "RESTART/TERMINATE INFO" during...
0
2407
by: GB | last post by:
In a log shipping scenario I would like to be able to test my database and set it back manually in roll forward pending state, is it possible ? What I would like to do in detail: - On the backup site: restore the main backup, rollforward the logs, ship new logs,rollforward the logs, ... (all this works) - I would like to be able to test from time to time the state of the database, so I stop the rollforward pending state, I do some...
3
11113
by: Stephen | last post by:
This is probably something simple but I've been trying for a while now and can't seem to get it. I'm loading a table from an IXF file with the following command 'load from D:/db_scripts/load_test/nlm.ixf of ixf modified by USEDEFAULTS method n (NOTIFY_LIST_ID,PUBLICATION_ID) insert into mediaadm.NOTIFY_LIST_MEMBERS' this works fine but afterwards the table goes into a 'check pending'
7
26062
by: satish mullapudi | last post by:
Hi All, I am using Db2 UDB v 8.2 on RHEL . I have performed a load operation on a table. Now that tablespace has been switched into RESTORE PENDING state. Now I can only read the data in the table. I can't modify the data in the table as it is giving me an error saying "Tablespace Access denied". How can I bring the tablespace out of RESTORE PENDING state? Please help me out Thnak you in Advance.......
4
25671
by: Mr. DOS | last post by:
IBM DB2 UDB Is there a SQl query I can send from the web server that will return a list of tables currently in the LOAD PENDING state? LOAD QUERY is not quite waht I'm looking for. Thanks!
1
3851
by: amitabh.mehra | last post by:
If I drop some constraints on a table by 'alter table..' query, does this table go into check pending state? If no, then what is the way to put this table into check pending state other than using the SET INTEGRITY statement?
1
24358
by: deangc | last post by:
I have some scripts that drop columns in DB2 9. This leaves the table in a REORG PENDING state: SQL0668N Operation not allowed for reason code "7" on table "tablename". SQLSTATE=57016 I want to write a script that finds all tables in this state and REORGs them, but I don't know how to generate a set of tables that are in this state: if I use REORGCHK_TB_STATS I will have to call it once for every table in the database. Is there an...
1
2755
by: balubkp | last post by:
Hai I Have One Doubt Can U Please Send Me The Answer How To Solve Load Pending State.
0
6074
by: msheikh25 | last post by:
After a failed informatica load session, when I try to select from a table it shows that the table is in Load Pending state: 1 ----------- SQL0668N Operation not allowed for reason code "3" on table "TABLE". SQLSTATE=57016 But then when I try to take it out of load pending state by running a
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.