DB2 Query to check table counts,start end time


 
Thread Tools Search this Thread
Top Forums Programming DB2 Query to check table counts,start end time
# 1  
Old 12-18-2017
DB2 Query to check table counts,start end time

Dear team

I am using DB2 and wish to capture the ETL status on daily basis so that i can run the query and share the details in xls format to respective mail ids .

Currently i am using below query but this displays table name and counts for latest run.

Code:
select name ,CARD from sysibm.systables
where creator ='Scheam name'
GROUP BY name,CARD
ORDER BY name

I need to have below details
1. If i have staging table as "STG_Customer" and Target table as "Customer", i would need to get the counts of each side by side , or immediate below the row .
Ex: STG_Customer -20 Customer -20 OR
STG_Customer -20
Customer -20
2.Additional columns along with table name and Counts. "Start Time", "End Time", "Load status --Success or Failure "
3.We keep on adding staging and target tables and hence cant hardcode in queries. Any feasible way to explore this requirement . Please do let me know.

I want to call this query in perl/python to send automated mails on daily basis.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting the Start, End time and duration using date command

Oracle Enterprise Linux We want to track how long a process takes to complete its execution. This is what we want in the schell script Before the process is started , get the time with date, hours and minutes execute the process After the process has ended , get the time with date,... (5 Replies)
Discussion started by: omega3
5 Replies

2. UNIX for Dummies Questions & Answers

Setup a cron job and specified the start and end time

Hi guys, How can I specify the start and end time of a cron job. And my start time and end time are specified by minutes. For example, I want to set up a cron runs every 3 minutes from 18:40 to midnight. How can i do this please? Many thanks Best regards, Clu (4 Replies)
Discussion started by: clu
4 Replies

3. Programming

sql query to match condition from other table (time sensitive)

I know little SQL and could really use a hand here. I need to get the fields last_name, first_name and email from the table users and only if the entery with the same pkey in the table addresses, in the city column is Seattle. So if the city in the addresses table is Seattle, go to the table... (2 Replies)
Discussion started by: computethis
2 Replies

4. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

5. UNIX for Dummies Questions & Answers

script start and end of execution of time

Hi All, Can we get to know the start time and end time of execution of a script? (This script doesn't write any logs.) I mean, is there any built in process logs to track these records? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

6. Shell Programming and Scripting

How to get data between the start time and end time?

Hi, Can anyone help me how can I get the line that between the start time and end time. file1.txt 15/03/2009 20:45:03 Request: - Data of this line 15/03/2009 20:45:12 Response: - Data of this line 15/03/2009 22:10:40 Request: - Data of this line 15/03/2009 22:10:42 Response: - Data of... (1 Reply)
Discussion started by: tanit
1 Replies

7. Shell Programming and Scripting

searching between start and end time

Hello All, Below mentioned is my log file. I want to make a script which ask for start time and then end time and then search particular word between those lines. Like start time:2 end time: 4 and then search all values starting from cell 84 between this time. Please Help ... (2 Replies)
Discussion started by: wakhan
2 Replies

8. Shell Programming and Scripting

Start time/end time and status of crontab job

Is there anyway to get the start time and end time / status of a crontab job which was just completed? Of course, we know the start time of the crontab job since we are scheduling. But I would like to know process start and time recorded somewhere or can be fetched from a command like 'ps'. ... (3 Replies)
Discussion started by: thambi
3 Replies

9. UNIX for Dummies Questions & Answers

Working out end time from start + elapsed

Hi, I'm writing a script and have become stuck trying to define a variable (COMP) by adding an elapsed time (ELAPSE e.g 00:55) to a start time (START e.g 23:50). Can anybody give me a solution as to how I can get a completion time in hh:mm from the variables above? thanks Richard (4 Replies)
Discussion started by: rik1551
4 Replies
Login or Register to Ask a Question
DB2_CLIENT_INFO(3)							 1							DB2_CLIENT_INFO(3)

db2_client_info - Returns an object with properties that describe the DB2 database client

SYNOPSIS
object db2_client_info (resource $connection) DESCRIPTION
This function returns an object with read-only properties that return information about the DB2 database client. The following table lists the DB2 client properties: DB2 client properties +---------------------+--------------------------------------+---+ | Property name | | | | | | | | | Return type | | | | | | | | Description | | | | | | +---------------------+--------------------------------------+---+ | APPL_CODEPAGE | | | | | | | | | int | | | | | | | | The application code page. | | | | | | | CONN_CODEPAGE | | | | | | | | | int | | | | | | | | The code page for the current con- | | | | nection. | | | | | | | DATA_SOURCE_NAME | | | | | | | | | string | | | | | | | | The data source name (DSN) used to | | | | create the current connection to the | | | | database. | | | | | | | DRIVER_NAME | | | | | | | | | string | | | | | | | | The name of the library that imple- | | | | ments the DB2 Call Level Interface | | | | (CLI) specification. | | | | | | | DRIVER_ODBC_VER | | | | | | | | | string | | | | | | | | The version of ODBC that the DB2 | | | | client supports. This returns a | | | | string "MM.mm" where $MM is the | | | | major version and $mm is the minor | | | | version. The DB2 client always | | | | returns "03.51". | | | | | | | DRIVER_VER | | | | | | | | | string | | | | | | | | The version of the client, in the | | | | form of a string "MM.mm.uuuu" where | | | | $MM is the major version, $mm is the | | | | minor version, and $uuuu is the | | | | update. For example, "08.02.0001" | | | | represents major version 8, minor | | | | version 2, update 1. | | | | | | |ODBC_SQL_CONFORMANCE | | | | | | | | | string | | | | | | | | The level of ODBC SQL grammar sup- | | | | ported by the client: | | | | | | | | o MINIMUM | | | | - Supports the mini- | | | | mum ODBC SQL gram- | | | | mar. | | | | | | | | o CORE | | | | - Supports the core | | | | ODBC SQL grammar. | | | | | | | | o EXTENDED | | | | - Supports extended | | | | ODBC SQL grammar. | | | | | | | ODBC_VER | | | | | | | | | string | | | | | | | | The version of ODBC that the ODBC | | | | driver manager supports. This | | | | returns a string "MM.mm.rrrr" where | | | | $MM is the major version, $mm is the | | | | minor version, and $rrrr is the | | | | release. The DB2 client always | | | | returns "03.01.0000". | | | | | | +---------------------+--------------------------------------+---+ PARAMETERS
o $connection - Specifies an active DB2 client connection. RETURN VALUES
Returns an object on a successful call. Returns FALSE on failure. EXAMPLES
Example #1 A db2_client_info(3) example To retrieve information about the client, you must pass a valid database connection resource to db2_client_info(3). <?php $conn = db2_connect( 'SAMPLE', 'db2inst1', 'ibmdb2' ); $client = db2_client_info( $conn ); if ($client) { echo "DRIVER_NAME: "; var_dump( $client->DRIVER_NAME ); echo "DRIVER_VER: "; var_dump( $client->DRIVER_VER ); echo "DATA_SOURCE_NAME: "; var_dump( $client->DATA_SOURCE_NAME ); echo "DRIVER_ODBC_VER: "; var_dump( $client->DRIVER_ODBC_VER ); echo "ODBC_VER: "; var_dump( $client->ODBC_VER ); echo "ODBC_SQL_CONFORMANCE: "; var_dump( $client->ODBC_SQL_CONFORMANCE ); echo "APPL_CODEPAGE: "; var_dump( $client->APPL_CODEPAGE ); echo "CONN_CODEPAGE: "; var_dump( $client->CONN_CODEPAGE ); } else { echo "Error retrieving client information. Perhaps your database connection was invalid."; } db2_close($conn); ?> The above example will output: DRIVER_NAME: string(8) "libdb2.a" DRIVER_VER: string(10) "08.02.0001" DATA_SOURCE_NAME: string(6) "SAMPLE" DRIVER_ODBC_VER: string(5) "03.51" ODBC_VER: string(10) "03.01.0000" ODBC_SQL_CONFORMANCE: string(8) "EXTENDED" APPL_CODEPAGE: int(819) CONN_CODEPAGE: int(819) SEE ALSO
db2_server_info(3). PHP Documentation Group DB2_CLIENT_INFO(3)