Help Needed: UNIX shell variables to store Oracle table records
Hello Folks,
I'm working on a requirement to automate the process of generating report(csv file) using metadata info stored in an Oracle table and E-mail it to respective people.
Meta data table:
To implement this I'm planning to store the metadata entries into Unix shell variables and create a loop and process each record(report_SUB_ID,DB, SQL etc) in the loop indivudally.
Then,planning to execute each SQL in the respective DB and spool the output of the SQL query to a csv file on the unix server and then attach it and send it to the respective user.
Can you please advise if my approach is right ? If not , please advise whats the best possible way to achieve this?
If yes , please suggest what type of shell variables I have to create and how can I looop through these values.
Thanks in Advance
Regards,
Venkat
Last edited by Don Cragun; 10-29-2015 at 04:27 PM..
Reason: Add CODE tags.
Hi friends,
I have to do the following things :
1) there should be a shell script returning the returning the return code of the script. and i have to add some more details like on which machine is has run , at what time and other details and then using plsql i have to add a row to Oracle... (3 Replies)
HI,
I'm trying to get this right, please can you help. In my unix korn shell script, I call an oracle stored proc within a package and I specify 3 parameters, 2 of which are IN OUT parameters (i.e. I expect the stored proc to change them and return them back to me).
Does the unix code... (7 Replies)
Hi,
I have delimited file(|).
Sample data:
1|name|50009|DS24|0|12
2|name|30009|DS24|0|13
3|name|20409|DS24|0|14
4|name|20009|DS24|0|15
5|name|10009|DS24|0|16
I want to load this data into a oracle table (update and insert)
Please help me the commands and also... (1 Reply)
I want to store contents of command
dir in array of variables
For eg: dir contents are
command d2 demovi~ file inven java new untitled folder
d1 demovi er1 filename inven~ myfiles ubuntu desktop xmms
-----------------------------------
I... (3 Replies)
Hi everyone, I am having some problems with my scripts so I hope you could help me.
I am trying to store the result of a division in a variable in tcshell but I have the problem that if:
For example, dividing 2/100 the result is 0.02 but if I store that I have "0".
How can I have 0.02... (8 Replies)
Hello,
I am new to UNIX.
My Requirement: Need to connect to Oracle database from UNIX and execute an SELECT statement and store the records in a flatfile of Comma delimiter.
What I have Succeeded: I was able to connect to Oracle from UNIX.
Problem: I cannot fetch multiple... (3 Replies)
I have a input file like this.
Sample.txt
30 | TXDatacenter | TXBackupDC
10 | UKDatacenter | UKBackupDC
0 | NLDatacenter | NLBackupDC
......
......
......
I need to get these values in different variables like this.
Load1=30
PriCenter1=TXDatacenter... (5 Replies)
how to store the count of queries in variables inside a filein shell script
my output :
filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
. (3 Replies)
Hi Friends,
I looking for the script for the count of the records in table.
and then it's containg the zero records then should get abort.
and should notify us through mail.
Can you please help me out in this area i am lacking. (5 Replies)
Discussion started by: victory
5 Replies
LEARN ABOUT LINUX
ndb_select_count
NDB_SELECT_COUNT() NDB_SELECT_COUNT()
NAME
ndb_select_count - print row counts for NDB tables
SYNOPSIS
ndb_select_count [-c connect_string] -d db_name tbl_name[ tbl_name2[ ...]]
DESCRIPTION
ndb_select_count prints the number of rows in one or more NDB tables. With a single table, the result is equivalent to that obtained by
using the MySQL statement SELECT COUNT(*) FROM tbl_name.
Usage
ndb_select_count [-c connect_string] -ddb_name tbl_name[, tbl_name2[, ...]]
The following table includes options that are specific to the MySQL Cluster native backup restoration program ndb_select_count. Additional
descriptions follow the table. For options common to most MySQL Cluster programs (including ndb_select_count), see Options Common to MySQL
Cluster Programs(1).
Table 17.25. ndb_select_count Options and Variables: MySQL Cluster NDB 7.2
+--------------------------+-----------------------------------+-------------------------------------+
|Format | Description | Added / Removed |
+--------------------------+-----------------------------------+-------------------------------------+
| | Name of the database in which the | |
| --database=dbname, | table is found | All MySQL 5.5 based releases |
| | | |
| -d | | |
+--------------------------+-----------------------------------+-------------------------------------+
| | Degree of parallelism | |
| --parallelism=#, | | All MySQL 5.5 based releases |
| | | |
| -p | | |
+--------------------------+-----------------------------------+-------------------------------------+
| | Lock type | |
| --lock=#, | | All MySQL 5.5 based releases |
| | | |
| -l | | |
+--------------------------+-----------------------------------+-------------------------------------+
You can obtain row counts from multiple tables in the same database by listing the table names separated by spaces when invoking this
command, as shown under Sample Output.
Sample Output
shell> ./ndb_select_count -c localhost -d ctest1 fish dogs
6 records in table fish
4 records in table dogs
NDBT_ProgramExit: 0 - OK
COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online
at http://dev.mysql.com/doc/.
AUTHOR
Oracle Corporation (http://dev.mysql.com/).
NDB_SELECT_COUNT()