Sponsored Content
Top Forums Shell Programming and Scripting Executing Multiple .SQL Files from Single Shell Script file Post 101307 by anushilrai on Tuesday 7th of March 2006 06:01:14 AM
Old 03-07-2006
I am trying to create database objects through the files.

The file names are simillar to the names of the objects they are creating.i want that if the object has been created successfully i get a success in my log file, and if any error then the error in the log file along with the file names

for views i have file with extension .VW, for Procedure .PRC and so on
i want files to be executed in the order
1. .VW
2. .FNC
3. .PRC
4. .SQL
5. .SQH
6. .SQB

Please help
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Executing a SQL query from a shell script

I cannot figure out how to run a SQL script, or just a sqlplus query, from a shell script (bash or ksh). Basically, I need to su - oracle from root and run a query, then test the exit status. (3 Replies)
Discussion started by: 98_1LE
3 Replies

2. UNIX for Dummies Questions & Answers

Sh Shell Script executing remote SQL queries

Hi there folks, I am trying to execute remote sql queries on an Oracle server. I would like to save the result of the executed sql queries on a text file, and send that text file as an attachment to an email address. Could anyone give me an idea on how the above could be achieved? Any help... (2 Replies)
Discussion started by: Javed
2 Replies

3. Shell Programming and Scripting

Executing Sql Query Using Shell Script

HI ALL i have a requirement like this. i have to write a shell script to run a sql query. DB is oracle. once the query is run, the results of the query has to be published in a data file. can you please advice me how to go about it. i am absolutely new to shell scripts and this is a part of my job. (14 Replies)
Discussion started by: ragha81
14 Replies

4. Shell Programming and Scripting

executing a SQL query in shell script

Hi ALL, I need an help in connecting to oracle database, executing a select query and printing it on the screen. Can any one please write a simple code or psuedo code and let me know. select query returns multiple values( say select name from emp) Thanks in advance LM (1 Reply)
Discussion started by: lijju.mathew
1 Replies

5. UNIX for Dummies Questions & Answers

split a single sql file into multiple files

Hi,I have a single sql file containing many create table ddl's.Example: CREATE TABLE sec_afs ( rpt_per_typ_c char(1) NOT NULL, rpt_per_typ_t varchar(20) NULL, LOCK ALLPAGES go EXEC sp_primarykey 'sec_afs', rpt_per_typ_c go GRANT SELECT ON sec_afs TO developer_read_only... (5 Replies)
Discussion started by: smarter_aries
5 Replies

6. Programming

Single sql query to spool to multiple files

Is there anyway to spool my select statement into spool files of max 10000 records each? eg I have a select statement that will return 45000 records. A normal spool command will output the 45000 into just one spool file. How can I make sqlplus do this? 00001 - 10000 records --- spool... (3 Replies)
Discussion started by: Leion
3 Replies

7. Shell Programming and Scripting

Executing a shell script from a PL / SQL Block

Hi, I need to call a shell script present on solaris server from within a PL / SQL block. Kindly suggest.. Thanks Sudhir (1 Reply)
Discussion started by: sudhird
1 Replies

8. UNIX for Dummies Questions & Answers

Regarding executing sql query in shell script

Hi, I have one SQL file prepared in UNIX and one script that is executing that. In SQL i have Update and create queries. I want to introduce conditions in SQL file (in UNIX) that if either of the create or update query failes whole transaction should be rollback. I just have 1 create... (2 Replies)
Discussion started by: abhii
2 Replies

9. UNIX for Beginners Questions & Answers

Help with Executing sql in Shell Script

Hello~ I have a requirement to write a shell script which will connect to the oracle database and run a select count(*) query on a table. The script should succeed only when the count returns a number greater than zero. If the count returns zero, the script should fail. Can someone please... (3 Replies)
Discussion started by: Naren.N
3 Replies

10. Shell Programming and Scripting

Tabbed multiple csv files into one single excel file with using shell script not perl

Hi Experts, I am querying backup status results for multiple databases and getting each and every database result in one csv file. so i need to combine all csv files in one excel file with separate tabs. I am not familiar with perl script so i am using shell script. Could anyone please... (4 Replies)
Discussion started by: ramakrk2
4 Replies
CREATE 
VIEW(7) SQL Commands CREATE VIEW(7) NAME
CREATE VIEW - define a new view SYNOPSIS
CREATE [ OR REPLACE ] VIEW view [ ( column name list ) ] AS SELECT query INPUTS view The name (optionally schema-qualified) of a view to be created. column name list An optional list of names to be used for columns of the view. If given, these names override the column names that would be deduced from the SQL query. query An SQL query (that is, a SELECT statement) which will provide the columns and rows of the view. Refer to SELECT [select(7)] for more information about valid arguments. OUTPUTS CREATE VIEW The message returned if the view is successfully created. ERROR: Relation 'view' already exists This error occurs if the view specified already exists in the database. WARNING: Attribute 'column' has an unknown type The view will be created having a column with an unknown type if you do not specify it. For example, the following command gives a warning: CREATE VIEW vista AS SELECT 'Hello World' whereas this command does not: CREATE VIEW vista AS SELECT text 'Hello World' DESCRIPTION
CREATE VIEW defines a view of a query. The view is not physically materialized. Instead, a query rewrite rule (an ON SELECT rule) is auto- matically generated to support SELECT operations on views. CREATE OR REPLACE VIEW is similar, but if a view of the same name already exists, it is replaced. You can only replace a view with a new query that generates the identical set of columns (i.e., same column names and data types). If a schema name is given (for example, CREATE VIEW myschema.myview ...) then the view is created in the specified schema. Otherwise it is created in the current schema (the one at the front of the search path; see CURRENT_SCHEMA()). The view name must be distinct from the name of any other view, table, sequence, or index in the same schema. NOTES Currently, views are read only: the system will not allow an insert, update, or delete on a view. You can get the effect of an updatable view by creating rules that rewrite inserts, etc. on the view into appropriate actions on other tables. For more information see CREATE RULE [create_rule(7)]. Use the DROP VIEW statement to drop views. USAGE
Create a view consisting of all Comedy films: CREATE VIEW kinds AS SELECT * FROM films WHERE kind = 'Comedy'; SELECT * FROM kinds; code | title | did | date_prod | kind | len -------+---------------------------+-----+------------+--------+------- UA502 | Bananas | 105 | 1971-07-13 | Comedy | 01:22 C_701 | There's a Girl in my Soup | 107 | 1970-06-11 | Comedy | 01:36 (2 rows) COMPATIBILITY
SQL92 SQL92 specifies some additional capabilities for the CREATE VIEW statement: CREATE VIEW view [ column [, ...] ] AS SELECT expression [ AS colname ] [, ...] FROM table [ WHERE condition ] [ WITH [ CASCADE | LOCAL ] CHECK OPTION ] The optional clauses for the full SQL92 command are: CHECK OPTION This option is to do with updatable views. All INSERT and UPDATE commands on the view will be checked to ensure data satisfy the view-defining condition. If they do not, the update will be rejected. LOCAL Check for integrity on this view. CASCADE Check for integrity on this view and on any dependent view. CASCADE is assumed if neither CASCADE nor LOCAL is specified. CREATE OR REPLACE VIEW is a PostgreSQL language extension. SQL - Language Statements 2002-11-22 CREATE VIEW(7)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy