473,321 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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.equals("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 4961
Check this in SYSTEM MONITOR GUIDE

tablespace_state_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.equals("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**********************@j33g2000cwa.googlegroups. 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.equals("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**********************@j33g2000cwa.googlegroups. 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.equals("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...one of them is sqlerrorcode....
how can i actually access the value of that paramenter...like ..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_cfg 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..any suggestons..I will google also...

Apr 14 '06 #10
As Bob [IBM] pointsout further, I used the wrong function:
This is the one you want: snapshot_tbs_cfg
It provides column:
TABLESPACE_STATE
The following link explains the retrun code values:
http://publib.boulder.ibm.com/infoce...n/t0010418.htm

HTH, Pierre.
PS - See what Google can do for you? With help from people to set me right,
I can find stuff!
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Pierre Saint-Jacques" <se*****@invalid.net> a écrit dans le message de
news: gE**********************@wagner.videotron.net...
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**********************@j33g2000cwa.googlegroups. 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.equals("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 15 '06 #11

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

Similar topics

1
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...
0
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...
3
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...
7
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...
4
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
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 ...
1
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...
1
by: balubkp | last post by:
Hai I Have One Doubt Can U Please Send Me The Answer How To Solve Load Pending State.
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.