TO execute .sql 2005 query file in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting TO execute .sql 2005 query file in shell script
# 1  
Old 04-01-2009
TO execute .sql 2005 query file in shell script

Hi,

I know in oracle a .sql file is called by @ <path> /<filename>.
But how to call in sql 2005, I am opening the sql sessionwith sqsh, is there any command to execute there a .sql file (query in sql 2005) in K shell script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Not able to write SQL query output in to .csv file with shell script.

I am trying to write SQL query output into a .csv file. But in the output columns are displaying in different lines instead of coming in one line. Main Code shell script: this is my code: #!/bin/bash file="db_detail.txt" . $file rm /batch/corpplan/bin/dan.csv... (6 Replies)
Discussion started by: sandeepgoli53
6 Replies

2. Shell Programming and Scripting

Shell script to execute sql query.

Hi Experts, Need your support. Not able to use sql query alias in shell script. Could you please help me in finding right way to use alias with sql query in shell script. Below is the code i am using. #!/bin/bash sqlplus -s abc/abc@abc << EOF> bcd.csv set trimspool on select zone_id... (4 Replies)
Discussion started by: as7951
4 Replies

3. Red Hat

Sql query through shell script

hey , i am using this code to store value of a sql query and and then use it in other query but after some time , but it is not working. please help #!/bin/bash val_1=$( sqlplus -s rte/rted2@rel76d2 << EOF setting heading off select max(stat_id) from cvt_stats; exit EOF ) nohup... (5 Replies)
Discussion started by: ramsavi
5 Replies

4. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

5. Shell Programming and Scripting

Execute SQL query in unix script

Hi I am new in unix. oracle and unix are installed in my sytem.i need the script which could connect to the oracle using username ,password and schema and can run the select * from tab query. Thanks vijay (8 Replies)
Discussion started by: vijays3
8 Replies

6. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

7. Shell Programming and Scripting

query sql using shell script

query sql using shell script, is it possible? my friend told me to do a file.sql and link to my shell script, but can i query sql using shell script? thanks in advance! (2 Replies)
Discussion started by: kingpeejay
2 Replies

8. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

9. Shell Programming and Scripting

Shell Script to execute SQL's

Hi people, i need youre help on this. I need to create an Shell SCript to list in a directory some sql files and then execute them one by one . Also i need to have Logs from the executed Sql's to send to our costummers. Can anyone help me on this Regards, osramos (2 Replies)
Discussion started by: osramos
2 Replies

10. Shell Programming and Scripting

How to execute a .sql file with shell script

hi everybody... can anyone help me in executing the .sql file with shell scripting.... thanx in advance (2 Replies)
Discussion started by: abuanas
2 Replies
Login or Register to Ask a Question
MDBTools(1)															       MDBTools(1)

NAME
mdb-sql - SQL interface to MDB Tools SYNOPSIS
mdb-sql [-HFp] [-d delimiter] [-i file] [-o file] [database] DESCRIPTION
mdb-sql is a utility program distributed with MDB Tools. mdb-sql allows querying of an MDB database using a limited SQL subset language. OPTIONS
-H Supress header row. -F Supress footer row. -p Turn off pretty printing. By default results are printed in an ascii table format which looks nice but is not conducive to manipu- lating the output with unix tools. This option prints output plainly in a tab separated format. -d Specify an alternative column delimiter. If no delimiter is specified, columns will be delimited by a tab character if pretty print- ing (-p) is turned off. If pretty printing is enabled this option is meaningless. -i Specify an input file. This option allows an input file containing the SQL to be passed to mdb-sql. See Notes. -o Specify an output file. This option allows the name of an output file to be used instead of stdout. COMMANDS
mdb-sql in interactive mode takes some special commands. connect to <database> If no database was specified on the command line this command is necessary before any querys are issued. It also allows the switch- ing of databases once in the tool. disconnect Will disconnect from the current database. go Each batch is sent to the parser using the 'go' command. reset A batch can be cleared using the 'reset' command. list tables The list tables command will display a list of available tables in this database, similar to the mdb-tables utility on the command line. describe table <table> Will display the column information for the specified table. quit Will exit the tool. SQL LANGUAGE
The currently implemented SQL subset is quite small, supporting only single table queries, no aggregates, and limited support for WHERE clauses. Here is a brief synopsis of the supported language. select: SELECT [* | <column list>] FROM <table> WHERE <where clause> column list: <column> [, <column list>] where clause: <column> <operator> <literal> [AND <where clause>] operator: =, =>, =<, <>, like, <, > literal: integers, floating point numbers, or string literal in single quotes NOTES
When passing a file (-i) or piping output to mdb-sql the final 'go' is optional. This allow constructs like echo "Select * from Table1" | mdb-sql mydb.mdb to work correctly. The -i command can be passed the string 'stdin' to test entering text as if using a pipe. ENVIRONMENT
MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. MDBOPTS semi-column separated list of options: o use_index o no_memo o debug_like o debug_write o debug_usage o debug_ole o debug_row o debug_props o debug_all is a shortcut for all debug_* options HISTORY
mdb-sql first appeared in MDB Tools 0.3. SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-ver(1) mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) AUTHORS
The mdb-sql utility was written by Brian Bruns. BUGS
The supported SQL syntax is a very limited subset and deficient in several ways. 0.7 13 July 2013 MDBTools(1)