Sponsored Content
Top Forums Shell Programming and Scripting Check the record count in table (table in oracle) Post 302271928 by otheus on Monday 29th of December 2008 05:32:21 AM
Old 12-29-2008
Generally, we're here to help, not do all the work for you. Here's a start to help you:
Code:
while true; do 
   records=`sqlplus "some sql code" `
   if [ $records = 0 ]; then 
       sqlplus "other sql code" > report.out
   fi
done

This doesn't do step 3 because I'm not sure what you mean by it.

Use this code to start on yours and come back here with a specific question when you are ready.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time (Go to sleep mode) and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

2. Shell Programming and Scripting

Unix command to extract a record from a table

Suppose there is a table like the following...I just wanted to know if there is any command using which we can get the record/name of the person who joined before 2005.. Sl Name des y.o.joining 1 Ram Engineer 2001 2 Hari Doctor 2004 3 David Plumber 2005 4 Rahim painter 2007 5 gurmeet... (1 Reply)
Discussion started by: satyajit007
1 Replies

3. Shell Programming and Scripting

Script to count the dataflow in a table in oracle database

I need to write a unix shell script to connect to oracle database and retrieve data from a table, the script should count the total number of rows till date in that table number of rows which are getting filled per hour on current day and the peak hour of the current day number of rows which are... (5 Replies)
Discussion started by: PhAnT0M
5 Replies

4. UNIX for Dummies Questions & Answers

Creating a condensed table from a pre-existing table in putty

Hello, I'm working with putty on Windows 7 professional and I'd like to know if there's a way to gather specific lines from a pre-existing table and make a new table with that information. More specifically, I'd like the program to look at a specific column, say column N, and see if any of the... (5 Replies)
Discussion started by: Deedee393
5 Replies

5. UNIX and Linux Applications

Help in copying table structure to another table with constraints in Oracle

hi, i need to copy one table with data into another table, right now am using create table table1 as select * from table2 i want the constraints of table1 to be copied to table2 also , can anyone give me some solution to copy the constraints also, now am using oracle 10.2.0.3.0... (1 Reply)
Discussion started by: senkerth
1 Replies

6. UNIX for Advanced & Expert Users

How can i populate the record in to table using shell scripting?

LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( echo "From: $pzFrom\nTo: $pzTo\nSubject: $pzTitle${pzReplyTo:+\nReply-To: $pzReplyTo}" ] && echo... (1 Reply)
Discussion started by: ankit.mca.aaidu
1 Replies

7. Shell Programming and Scripting

Help to check if Oracle table exists

I am trying to write a script which allows a user to select the what manipulation he needs to do on a table. I want to check if the table exists or not. If it exists I will continue the other things or else I exit saying table doesn't exist. How might I achieve this. (1 Reply)
Discussion started by: gmatcat
1 Replies

8. UNIX and Linux Applications

UNIX spool command not extracting complete record from the Oracle table

Hello All, I'm trying to spool an oracle table data into a csv file on unix server but the complete record is not being extracted. The record is almost 1000 characters but only 100 characters are being extracted and rest of the data getting truncated. I'm setting below options : SET... (4 Replies)
Discussion started by: venkat_reddy
4 Replies

9. Web Development

Getting Rid of Annoying Bootstrap Table Borders and Wayward Table Lines

Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer: <script> $(function(){ $('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
DELETE(7)							   SQL Commands 							 DELETE(7)

NAME
DELETE - delete rows of a table SYNOPSIS
DELETE FROM [ ONLY ] table [ WHERE condition ] INPUTS table The name (optionally schema-qualified) of an existing table. condition This is an SQL selection query which returns the rows which are to be deleted. Refer to the SELECT statement for further description of the WHERE clause. OUTPUTS DELETE count Message returned if items are successfully deleted. The count is the number of rows deleted. If count is 0, no rows were deleted. DESCRIPTION
DELETE removes rows which satisfy the WHERE clause from the specified table. If the condition (WHERE clause) is absent, the effect is to delete all rows in the table. The result is a valid, but empty table. Tip: TRUNCATE [truncate(7)] is a PostgreSQL extension which provides a faster mechanism to remove all rows from a table. By default DELETE will delete tuples in the table specified and all its sub-tables. If you wish to only update the specific table men- tioned, you should use the ONLY clause. You must have write access to the table in order to modify it, as well as read access to any table whose values are read in the condition. USAGE
Remove all films but musicals: DELETE FROM films WHERE kind <> 'Musical'; SELECT * FROM films; code | title | did | date_prod | kind | len -------+---------------------------+-----+------------+---------+------- UA501 | West Side Story | 105 | 1961-01-03 | Musical | 02:32 TC901 | The King and I | 109 | 1956-08-11 | Musical | 02:13 WD101 | Bed Knobs and Broomsticks | 111 | | Musical | 01:57 (3 rows) Clear the table films: DELETE FROM films; SELECT * FROM films; code | title | did | date_prod | kind | len ------+-------+-----+-----------+------+----- (0 rows) COMPATIBILITY
SQL92 SQL92 allows a positioned DELETE statement: DELETE FROM table WHERE CURRENT OF cursor where cursor identifies an open cursor. Interactive cursors in PostgreSQL are read-only. SQL - Language Statements 2002-11-22 DELETE(7)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy