Sponsored Content
Top Forums Shell Programming and Scripting Assigning value of a select count(*) from tablename ( run on db2 ) to a unix variable Post 302466207 by larsbh on Tuesday 26th of October 2010 12:11:07 AM
Old 10-26-2010
Follow this format:

db2 connect to dbname...
myvar=$(db2 -x "select count(*) from schema.table")
print "myvar = $myvar"
db2 connect reset
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

select count(*) into a variable

Hi, Could anybody help me how can I assign the value of "select count(*) from table1" to a variable in an unix shell script. Thanks. (4 Replies)
Discussion started by: nguda
4 Replies

2. Shell Programming and Scripting

DB2 and Unix Variable .....

Guys Quick help... ---------------------------- #!/usr/bin/ksh db2 -x "select count(*) from ${SCHEMA}.EMP"> $HOME/count.dat COUNT=`cat $HOME/count.dat` echo Table Count: $COUNT if ( $COUNT -eq 0 ); then echo Record Count in Table is 0 exit 1 fi echo Records Exist... (2 Replies)
Discussion started by: freakygs
2 Replies

3. UNIX for Dummies Questions & Answers

select count(*) in sqlplus into variable unix shell

Need to select count(*) from table to check for zero result in unix script (2 Replies)
Discussion started by: struggle
2 Replies

4. Shell Programming and Scripting

Storing count(*) into unix variable

Hi, I've just started on unix shell scripting a few days ago. I tried look for the solution to my problem over the net but to no avail. The objective of my script is to count the number of records in a particular table from a Oracle database. Ok, here's my problem, when I run this script: ... (1 Reply)
Discussion started by: mervinboyz
1 Replies

5. Shell Programming and Scripting

How to redirect value from sql select statment to unix variable

Hi, I need to get the value from the table using the sql command and store this value into the unix variable so that i can use this value for furthure use.. Please can any body help me in this regards Thanks & Regards Abdul Hafeez Shaik (17 Replies)
Discussion started by: abdulhafeez
17 Replies

6. UNIX for Dummies Questions & Answers

using unix variable in select column in awk

Hi, I have file on below pattern, and i want to write a generic awk to handle all cases. input_file: col1~col2~col3~col4~col5~col6 I need to generate 4 files something like this File1: col1~~col2~~col3 File2: col1~~col2~~col4 File3: col1~~col2~~col5 File4: col1~~col2~~col6 (1 Reply)
Discussion started by: luckybalaji
1 Replies

7. Shell Programming and Scripting

Run DB2 export command in loop

Hi All, I have list of 100 table names in a file, how to read table name from and pass to DB2 export command and run for all tables in loop. Please help me with script. db2 EXPORT TO ~/data_export/<table name from file>.ixf OF IXF MESSAGES messages.txt "SELECT * FROM ITG.<Table Name... (4 Replies)
Discussion started by: srimitta
4 Replies

8. UNIX for Advanced & Expert Users

Using xml to run db2 commands

Hi, Strange problem I'm having here and not sure what to do. I have here a xml that is supposed to execute the next value in the schema but it isn't do the job it's supposed to do. I'm not a dba or a developer so I'm sorry in advance if there are some things i don't understand. when we run... (5 Replies)
Discussion started by: techy1
5 Replies

9. Shell Programming and Scripting

Expect - assigning UNIX command output to a variable

Hi, I'm writing a script that connects through ssh (using "expect") and then is supposed to find whether a process on that remote machine is running or not. Here's my code (user, host and password are obviously replaced with real values in actual script): #!/usr/bin/expect set timeout 1... (3 Replies)
Discussion started by: oseri
3 Replies

10. Shell Programming and Scripting

Python Script to take file count and insert into DB2 table

Team I have files in different directories . How can i take the count of latest file and insert into Db2 table . I am using awk 'END{print NR+1-ARGC}' (File name) to get the counts. How can i take 1.The count of latest file 2.Insert into Db2 table( File Name and Counts) . cd... (4 Replies)
Discussion started by: Perlbaby
4 Replies
Prima::HelpViewer(3)					User Contributed Perl Documentation				      Prima::HelpViewer(3)

NAME
Prima::HelpViewer - the built-in pod file browser USAGE
The module presents two packages, "Prima::HelpViewer" and "Prima::PodViewWindow". Their sole purpose is to serve as a mediator between "Prima::PodView" package, the toolkit help interface and the user. "Prima::PodViewWindow" includes all the user functionality, including ( but not limited to :) text search, color and font setup, printing etc. "Prima::HelpViewer" provides two methods - "open" and "close", used by "Prima::Application" for help viewer invocation. Help The browser can be used to view and print POD ( plain old documentation ) files. See the command overview below for more detailed description: File Open Presents a file selection dialog, when the user can select a file to browse in the viewer. The file must contain POD content, otherwise a warning is displayed. Goto Asks for a manpage, that is searched in PATH and the installation directories. New window Opens the new viewer window with the same context. Run Commands in this group call external processes p-class p-class is Prima utility for displaying the widget class hierachies. The command asks for Prima class to display the hierachy information for. Print Provides a dialog, when the user can select the appropriate printer device and its options. Prints the current topic to the selected printer. If "Full text view" menu item is checked, prints the whole manpage. Close window Closes the window. Close all windows Closes all help viewer windows. View Increase font Increases the currently selected font by 2 points. Decrease font Decreases the currently selected font by 2 points. Full text view If checked, the whole manpage is displayed. Otherwise, its content is presented as a set of topic, and only one topic is displayed. Find Presents a find dialog, where the user can select the text to search and the search options - the search direction, scope, and others. Find again Starts search for the text, entered in the last find dialog, with the same search options. Fast find The following commands provide a simple vi-style text search functionality - character keys ?,/,n,N bound to the commands below: Forward Presents an input line where a text can be entered; the text search is performed parallel to the input. Backward Same as Forward option, except that the serach direction is backwards. Repeat forward Repeat the search in the same direction as the initial search was being invoked. Repeat backward Repeat the search in the reverse direction as the initial search was being invoked. Setup Presents a setup dialog, where the user can select appropriate fonts and colors. Go Back Displays the previously visited manpage ( or topic ) Forward Displays the previously visited manpage ( or topic ), that was left via Back command. Up Displays the upper level topic within a manpage. Previous Moves to the previous topic within a manpage. Next Moves to the next topic within a manpage. Help About Displays the information about the help viewer. Help Displays the information about the usage of the help viewer AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. COPYRIGHT
This program is distributed under the BSD License. perl v5.14.2 2009-02-24 Prima::HelpViewer(3)
All times are GMT -4. The time now is 05:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy