10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
2. Shell Programming and Scripting
Hi,
I want to retrieve the base table name for a table and replace the table with the view name in the file.
I was trying to retrieve the base with the below db2 command but i am getting "1" as return value.
Could you anyone please assist ?
Table_name=system("db2 -x... (4 Replies)
Discussion started by: Nandy
4 Replies
3. Shell Programming and Scripting
Hi,
Im new to DB2.
I need to connect to DB2 from shell script and return the query output back to shell script variable.
this is my code
#!/bin/ksh
db_name=db
db_user=usr
db_pwd=pwd
db2 <<EOSQL
connect to $db_name user $db_user using "$db_pwd"
select count(1) from table
quit
EOSQL ... (3 Replies)
Discussion started by: sup
3 Replies
4. Shell Programming and Scripting
I want to connect to DB2 database which is mainframes using a unix script and run query and get the result set into the unix box.
Is this acheivable using db2 connect? pls help me with a sample script which can perform the same. (1 Reply)
Discussion started by: midhun19
1 Replies
5. AIX
Dear friends I am going to study DB2 and i dont have any experience with any DB's.. Please provide me with some links or pdf's for DB2 starters.
any advice will be very usefull (2 Replies)
Discussion started by: Vit0_Corleone
2 Replies
6. Shell Programming and Scripting
i want to run a db2 query though shell script
but i want my where condition element to chnage everytime like class_nm='abc' next time class_nm='def' next time
i want it to do by passing parameters to unix script
can someone give example how can i do it (0 Replies)
Discussion started by: er_zeeshan05
0 Replies
7. UNIX for Advanced & Expert Users
Suppose I am executing a sql query thru shell script.
DB : IBM DB2
If none of the rows are fetched, I will be getting the sql code as 100
If rows > 0 are fetched, I will be getting the sqlcode as 0
Can any one help me how to get this SQL code in unix shell script (in KSH)
... (1 Reply)
Discussion started by: regnumber
1 Replies
8. UNIX for Dummies Questions & Answers
Hi...
I m working on UNIX z/OS. Actually i have to pass the parameters from the JCL to java-db2 program thru PARM. I am able to pass the arguments but the problem occured is, it is throwing an exception while loading the db2 driver as 'Javaclassnotfound:com.ibm.db2.jcc.DB2Driver'... (0 Replies)
Discussion started by: Sujatha Gowda
0 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
10. AIX
Hi everyone.
I am currently looking for a monitor to monitor my DB2 UDB database, which runs on AIX 5.3. Does anyone here use any good ones or has anyone heard of any good ones?
I especially need to monitor which applications run at any given time, so that I am able to ballance the workload... (0 Replies)
Discussion started by: sprellari
0 Replies
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)