conditional writing of sql code


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting conditional writing of sql code
# 1  
Old 09-21-2004
conditional writing of sql code

Hello again... I have a request from another department to list for them all the columns and tables we use in this certain database. I have spooled the oracle stored procedured into 1 file. I need a way to write out parts of that file. The criteria is to to start the block to be written when the word "SELECT" is found, end the block when either a semicolon or the word "WHERE" is found. I suspect there are mixed case versions of these words but this should get over 95% of the cases.

thanks in advance for any help.
Kathy

never mind stopping at the WHERE clause, we have to take that clause too. SO realy we can stop the block at the next semicolon...

Last edited by kburrows; 09-21-2004 at 04:30 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

2. Shell Programming and Scripting

Help writing code

Hi, i need a string that take from a log file just two words (ngwan0) and his related ip address and then execute 2 commands in a shell. Any ideas where to start? Thanks (3 Replies)
Discussion started by: Board27
3 Replies

3. Programming

Help writing SQL query

Hello All, I hope I'm posting this in the right section. I have zero sql query writing skill, in fact, I've never done it before, but for some reason, a request came across my desk to get information from one of our databases. I have about 200 ticket numbers that have no information attached,... (8 Replies)
Discussion started by: bbbngowc
8 Replies

4. Shell Programming and Scripting

Column not allowed, when I am writing sql in UNIX

Please advice to rectify below error #!/bin/ksh X=$(sqlplus -s user/pass << EOSQL set serveroutput on; set heading off feedback off serveroutput on trimout on pagesize 0 INSERT INTO TEST(df) VALUES('a'); COMMIT; EXIT; EOSQL) echo $X echo $? ERROR at line 2: ORA-00984: column not... (1 Reply)
Discussion started by: mirwasim
1 Replies

5. Shell Programming and Scripting

To create a file writing a SQL into it from another file

Hi, I have a file in which I have database information along with 1 SELECT statement. Only 1 statement would be there. I want to grep this SELECT STATEMENT only and write into a separate file. Input File format: Database_Name:<database> Schema_Name:<schema> Table_Name:<table> Select *... (3 Replies)
Discussion started by: ustechie
3 Replies

6. Shell Programming and Scripting

Writing sql results to file using ksh -nevermind

I'm having problems with writing my sql results to a file: sqlplus -S username/password@DB <<!! set echo off set verify off set showmode off set feedback off set timing off set linesize 250 set wrap off set pagesize 0 set newpage none set tab off set trimspool on set colsep... (1 Reply)
Discussion started by: avillanueva
1 Replies

7. Homework & Coursework Questions

Writing Code

1. The problem statement, all variables and given/known data: Write a script that will perform the grep command on a user defined file and a user defined pattern 2. Relevant commands, code, scripts, algorithms: must use grep command (that is the only piece of information that was given) ... (2 Replies)
Discussion started by: akjim101
2 Replies

8. Shell Programming and Scripting

writing the output of SQL into one file

Hi All, Please help me writing the below script. I have two sql queries. 1. Select count(1),Client_id from TABLE_A group by Client_id; 2. Select count(1),Client_id from TABLE_B group by Client_id; I need the output of above two sql queries in a single file. The output 2nd query should be... (4 Replies)
Discussion started by: 46019
4 Replies

9. Programming

Writing to a File using pl/sql

Hi I am new to using pl/sql on a unix platform and am having trouble writing to a file from within a block. Below is an example of the code that I have. I know that I need to use UTL_FILE to accomplish this; however, I keep getting errors. Can someone please help me? I am trying to create a... (1 Reply)
Discussion started by: stky13
1 Replies

10. Shell Programming and Scripting

writing code!!!

suppose by writing this code "$ /sbin/ifconfig eth0| grep 'inet addr:' " i've got this output "inet addr:192.168.2.1 Mask:255.255.255.0" now if i want to see the output like this "IP address: 192.168.2.1 Subnet Mask: 255.255.255.0" what is the code should be? can anyone... (3 Replies)
Discussion started by: shelly
3 Replies
Login or Register to Ask a Question
SQLOBJECT-ADMIN(1)					      General Commands Manual						SQLOBJECT-ADMIN(1)

NAME
sqlobject-admin - manage your database as defined with SQLObject classes SYNOPSIS
sqlobject-admin [options] command DESCRIPTION
The sqlobject-admin tool included with SQLObject allows you to manage your database as defined with SQLObject classes. Some of the features include creating tables, checking the status of the database, recording a version of a schema, and updating the database to match the version of the schema in your code. COMMANDS
The following commands are recognized: help Show the help text. create Find the tables and create them. Existing tables are simply skipped. sql Show the SQL to create all the tables. drop Drop tables. Missing tables are skipped. execute Execute an arbitrary SQL expression. list List out all the found classes. status Show if tables are present in the database. record Record historical information about the database status upgrade Update the database to a new version (as created by record) OPTIONS
-c CONNECTION, --connection=CONNECTION Connection string for the database . -f FILENAME, --config-file=FILENAME Configuration file from which to get the connection to the database. -m MODULE, --module=MODULE A module to look in for classes. -p PACKAGE, --package=PACKAGE A package to look in. --class=CLASSMATCH Restricting the found classes to the matching classes. --egg=EGG_SPEC Egg description that should be loaded. AUTHORS
This manual page was written by Carl Chenet <chaica@ohmytux.com>. LICENSE
This package is licensed under the GNU Lesser General Public License. You can find the full text of the LGPL in /usr/share/common-licenses/LGPL in your Debian system. 06/03/2010 SQLOBJECT-ADMIN(1)