10-21-2015
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
How can i use the below unix command in AWK . Can any one please suggest me how i can use.
sed -e "s/which first.sh/which \$0/g" $shell > $shell.sal
where $0=current program name(say current.sh)
$shell=second.sh (1 Reply)
Discussion started by: krishna_gnv
1 Replies
2. Shell Programming and Scripting
meas is a shell variable, and this works perfectly fine for me:
awk -v var=$meas -F, '$1==var' /abcd/efgh.txt > temp1.csv
However, i want to introduce another shell variable, named, defnfile in the statement, in place of hardcoded path for efgh.txt like:
awk -v var=$meas -F, '$1==var'... (3 Replies)
Discussion started by: indianjassi
3 Replies
3. Shell Programming and Scripting
Hi,
I have written a code to modify a string say,
StringA=abc,def,ghi
I need to change it to something like:
StringB=This means abc='ABC', This mean def='DEF', This means ghi= 'GHI'
StringB=$(echo $StringA | awk -F',' 'BEGIN { OFS="," } { for (i=1; i<=NF;i++) $i="This means... (2 Replies)
Discussion started by: tostay2003
2 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to alter all lines between EXEC SQL and END-EXEC that have an INCLUDE in them.
The following code
search="INCLUDE "
cp -f ${WORK}/$file.in ${WORK}/$file.wrk2
for item in `echo $search `; do
> ${WORK}/$file.wrk1
awk -vITEM="$item" '{
if ( $0... (3 Replies)
Discussion started by: Bruble
3 Replies
5. Shell Programming and Scripting
Hi,
As per my understanding, we can use two shebang statements in a single shell script. Please see below snippet-
#!/bin/bash
.......## some code A
#!/bin/csh
.......## some code B
exit 0;
Here, code A will be executed using bash shell and code B will be executed with c shell.
... (9 Replies)
Discussion started by: tarunmudgal4u
9 Replies
6. Shell Programming and Scripting
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies
7. Shell Programming and Scripting
Hello, I wrote the case on code but it mistakes. I am not sure.
If/elif code:
#!/bin/ksh
you=$LOGNAME
hour=`date | awk '{print substr($4, 1, 2)}'`
print "The time is: $(date)"
if (( hour > 0 && $hour < 12 ))
then
print "Good morning, $you!"
elif (( hour == 12 ))
then (7 Replies)
Discussion started by: Masterpoker
7 Replies
8. Shell Programming and Scripting
Hi all,
I am running a curl statement in my script to extract some information form a remote server.
My curl statement is :
curl --socks5 142.133.134.164:1082 'http://11.229.52.71:8011/WebApp/common/version'
This gives me an output of :
$ curl --socks5 142.133.134.164:1082... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
9. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
10. Shell Programming and Scripting
Hi,
Need help, using awk command to insert statement
awk -v q="'" '{ print "db2 connect to repolab > /dev/null; " "\n" "db2 -x \" select name from IBMPDQ.PROFILE where managed_database = " q $1"_"$3"__0" q "\"" } ' profile.txt | sh - | awk -v i="'" ' { print "db2 connect to repolab >... (1 Reply)
Discussion started by: Mathew_paul
1 Replies
LEARN ABOUT PHP
db2_columns
DB2_COLUMNS(3) 1 DB2_COLUMNS(3)
db2_columns - Returns a result set listing the columns and associated metadata for a table
SYNOPSIS
resource db2_columns (resource $connection, [string $qualifier], [string $schema], [string $table-name], [string $column-name])
DESCRIPTION
Returns a result set listing the columns and associated metadata for a table.
PARAMETERS
o $connection
- A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
o $qualifier
- A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass NULL or an empty string.
o $schema
- The schema which contains the tables. To match all schemas, pass '%'.
o $table-name
- The name of the table or view. To match all tables in the database, pass NULL or an empty string.
o $column-name
- The name of the column. To match all columns in the table, pass NULL or an empty string.
RETURN VALUES
Returns a statement resource with a result set containing rows describing the columns matching the specified parameters. The rows are com-
posed of the following columns:
+------------------+---------------------------------------------------+
| Column name | |
| | |
| | Description |
| | |
+------------------+---------------------------------------------------+
| TABLE_CAT | |
| | |
| | Name of the catalog. The value is NULL if this |
| | table does not have catalogs. |
| | |
| TABLE_SCHEM | |
| | |
| | Name of the schema. |
| | |
| TABLE_NAME | |
| | |
| | Name of the table or view. |
| | |
| COLUMN_NAME | |
| | |
| | Name of the column. |
| | |
| DATA_TYPE | |
| | |
| | The SQL data type for the column represented as |
| | an integer value. |
| | |
| TYPE_NAME | |
| | |
| | A string representing the data type for the col- |
| | umn. |
| | |
| COLUMN_SIZE | |
| | |
| | An integer value representing the size of the |
| | column. |
| | |
| BUFFER_LENGTH | |
| | |
| | Maximum number of bytes necessary to store data |
| | from this column. |
| | |
| DECIMAL_DIGITS | |
| | |
| | The scale of the column, or NULL where scale is |
| | not applicable. |
| | |
| NUM_PREC_RADIX | |
| | |
| | An integer value of either 10 (representing an |
| | exact numeric data type), 2 (representing an |
| | approximate numeric data type), or NULL (repre- |
| | senting a data type for which radix is not appli- |
| | cable). |
| | |
| NULLABLE | |
| | |
| | An integer value representing whether the column |
| | is nullable or not. |
| | |
| REMARKS | |
| | |
| | Description of the column. |
| | |
| COLUMN_DEF | |
| | |
| | Default value for the column. |
| | |
| SQL_DATA_TYPE | |
| | |
| | An integer value representing the size of the |
| | column. |
| | |
|SQL_DATETIME_SUB | |
| | |
| | Returns an integer value representing a datetime |
| | subtype code, or NULL for SQL data types to which |
| | this does not apply. |
| | |
|CHAR_OCTET_LENGTH | |
| | |
| | Maximum length in octets for a character data |
| | type column, which matches COLUMN_SIZE for sin- |
| | gle-byte character set data, or NULL for non- |
| | character data types. |
| | |
|ORDINAL_POSITION | |
| | |
| | The 1-indexed position of the column in the ta- |
| | ble. |
| | |
| IS_NULLABLE | |
| | |
| | A string value where 'YES' means that the column |
| | is nullable and 'NO' means that the column is not |
| | nullable. |
| | |
+------------------+---------------------------------------------------+
SEE ALSO
db2_column_privileges(3), db2_foreign_keys(3), db2_primary_keys(3), db2_procedure_columns(3), db2_procedures(3), db2_special_columns(3),
db2_statistics(3), db2_table_privileges(3), db2_tables(3).
PHP Documentation Group DB2_COLUMNS(3)