12-05-2012
How to write bash shell script for mentioned requirement?
Hi All,
I am unable to write the script for the below requirement.
Requirement:
Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" .
This dir_ancillary contain undefined tables in the column "dir_ancillary.table_name".
I need to write the script like the way- IF "dir_ancillary.Include" column contain 'Y' value for "dir_ancillary.table_name" then I need to unload all of the data for that dir_ancillary.table_name to a file name that is contained in dir_ancillary.text_file_name and include it in the Ancillary.zip file .
Please let me know how could it posibble to make it by Unix script becaue we have unlimited (not defined) tables in table_name column. It is dynamic .it could be 10 or 30,50 , 90. any number.
Please reply me.
Thanks Unix team for helping me.
Last edited by Corona688; 12-05-2012 at 11:34 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I joined today in this forum to have all of your help.
I have a Big requirement, pls. help me to resolve.
I'm using HP-UX 11.23. I need a shell script for the following requirement.
I have a file (nodes.txt) that contains 1000 nodes.
I'm running the following command:... (3 Replies)
Discussion started by: ntgobinath
3 Replies
2. Shell Programming and Scripting
hi, first congratulations on the nice forum!
Can anybody write script, which can make copy of some or all files of the current directory in new directory (called "backups", which must be made in the current directory, if it's not already exist). And bring out a massage (report) with the count... (7 Replies)
Discussion started by: Cecko
7 Replies
3. Homework & Coursework Questions
I am very new to Linux/Unix. Kindly assist the following:
I wish to write a bash shell script called how_many_to_go that calculates and prints the number of days, hours, minutes and/or seconds until the end of the current month (based on the output of the date command).
Do ... (2 Replies)
Discussion started by: alobi
2 Replies
4. Shell Programming and Scripting
hello Forum members,
I have a encrypted file which consist Unames and Pwd in the encrypted form and i have to write a script the PWD from the file and redirect into a log file.please find below the file and please help write a script.
_config.id_dbs is the file which will open with a... (0 Replies)
Discussion started by: rajkumar_g
0 Replies
5. Shell Programming and Scripting
I am newbie to UNIX. I came across this exercise in one the books.Can anyone help me with this question??????
Write a short Bash script that, given the name of a file as an argument,
reads the file name and creates a new file containing only lines which consist
of one word. Here is an example... (4 Replies)
Discussion started by: krthknaidu
4 Replies
6. Shell Programming and Scripting
Hi,
I am not so familiar with shell Script but I have a task in hand. So, here it goes:
There is a file details.txt in the server where the below details are stored:
Name Country D M Acc.No.
sameer India 30 july sscc-errttt-q
random US 20 july pecc-ttt4-s
Deb India 31... (3 Replies)
Discussion started by: neel87
3 Replies
7. Shell Programming and Scripting
Hi,
I am trying to edit the values in a file. For example i am trying to edit the value of "ABC" in a file by executing shell script.
Please Note that ABC value can be there mulitple times or it may not be there in the file
Conditions for it is
1. If ABC is less than 123 then it should... (14 Replies)
Discussion started by: darling
14 Replies
8. UNIX for Dummies Questions & Answers
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
9. Shell Programming and Scripting
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
10. UNIX for Beginners Questions & Answers
Hello guys, I need some help. I am new in bash and I don't know how to automate the following script.
head -2 out1 > 1.fasta
sed ‘1,2 d' out1 > out2
rm out1
head -2 out2 > 2.fasta
sed ‘1,2 d' out2 > out1
rm out2
head -2 out2 > 3.fasta
sed '1,2 d' out2 > out1
rm out2
.......... (3 Replies)
Discussion started by: dellia222
3 Replies
LEARN ABOUT PHP
sqlite_fetch_column_types
SQLITE_FETCH_COLUMN_TYPES(3) SQLITE_FETCH_COLUMN_TYPES(3)
sqlite_fetch_column_types - Return an array of column types from a particular table
SYNOPSIS
array sqlite_fetch_column_types (string $table_name, resource $dbhandle, [int $result_type = SQLITE_ASSOC])
DESCRIPTION
Object oriented style (method): array SQLiteDatabase::fetchColumnTypes (string $table_name, [int $result_type = SQLITE_ASSOC])
sqlite_fetch_column_types(3) returns an array of column data types from the specified $table_name table.
PARAMETERS
o $table_name
- The table name to query.
o $dbhandle
- The SQLite Database resource; returned from sqlite_open(3) when used procedurally. This parameter is not required when using the
object-oriented method.
o $result_type
- The optional $result_type parameter accepts a constant and determines how the returned array will be indexed. Using SQLITE_ASSOC
will return only associative indices (named fields) while SQLITE_NUM will return only numerical indices (ordinal field numbers).
SQLITE_ASSOC is the default for this function.
RETURN VALUES
Returns an array of column data types; FALSE on error.
The column names returned by SQLITE_ASSOC and SQLITE_BOTH will be case-folded according to the value of the sqlite.assoc_case configuration
option.
CHANGELOG
+--------+--------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------+
| 5.1.0 | |
| | |
| | Added $result_type |
| | |
+--------+--------------------+
EXAMPLES
Example #1
Procedural example
<?php
$db = sqlite_open('mysqlitedb');
sqlite_query($db, 'CREATE TABLE foo (bar varchar(10), arf text)');
$cols = sqlite_fetch_column_types('foo', $db, SQLITE_ASSOC);
foreach ($cols as $column => $type) {
echo "Column: $column Type: $type
";
}
?>
Example #2
Object-oriented example
<?php
$db = new SQLiteDatabase('mysqlitedb');
$db->query('CREATE TABLE foo (bar varchar(10), arf text)');
$cols = $db->fetchColumnTypes('foo', SQLITE_ASSOC);
foreach ($cols as $column => $type) {
echo "Column: $column Type: $type
";
}
?>
The above example will output:
Column: bar Type: VARCHAR
Column: arf Type: TEXT
PHP Documentation Group SQLITE_FETCH_COLUMN_TYPES(3)