Sponsored Content
Top Forums Shell Programming and Scripting To pass the .sql file as a paramter to sqlplus through shell programming Post 302205935 by jim mcnamara on Monday 16th of June 2008 02:13:38 PM
Old 06-16-2008
use a here document
Code:
sqlplus -s user/pswd@somedb <<EOF
START 1.sql
EXIT
EOF

START is pretty much the same as @.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass Shell variables to sqlplus use them as parameters

Hi, I am trying to pass some of the variables in my shell scripts to the sqlplus call and use them as parameters. For example, I would like to replace the 'SAS', and '20050612' with $var1 and $var2, respectively, how can I do that? --------------------------------------------------------... (1 Reply)
Discussion started by: Jtrinh
1 Replies

2. Shell Programming and Scripting

How to pass parameter from sqlplus(procedure completed) to your shell script

if then # mail -s "Import failed file does not exist" sanjay.jaiswal@xyz.com echo "FILE does not exist" exit 1 fi echo "FILE EXIST" size=-1 set $(du /export/home/oracle/nas/scott21.dmp.gz) while do echo "Inside the loop" size=$1 set $(du... (1 Reply)
Discussion started by: sanora600
1 Replies

3. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

4. Shell Programming and Scripting

How to pass arguments to SQL file passed in shell script?

Hi, I am using SYBASE database. in my script i am connecting to DB via using isql. isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 Replies

5. UNIX and Linux Applications

how to execute multiple .sql scripts from within a shell script using sqlplus

using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks any help would be appreciated :wall: (1 Reply)
Discussion started by: TRS80
1 Replies

6. Shell Programming and Scripting

Can't get shell parameters to pass properly to sqlplus

Gurus, The issue I'm having is that my Shell won't accept SQL parameters properly...... Here's they way I'm running it.... applmgr@ga006hds => sh CW_MigrationDeployScript.sh apps <appspwd> <SID> '01-JAN' '31-MAR' The process just hangs not submitting the SQL job... ... (3 Replies)
Discussion started by: WhoDatWhoDer
3 Replies

7. Shell Programming and Scripting

How to pass Variable from shell script to select query for SqlPlus?

echo "set echo off"; echo "set feedback off"; echo "set linesize 4000"; echo " set pagesize 0"; echo " set sqlprompt ''"; echo " set trimspool on"; Select statement is mentioned below echo "select res.ti_book_no from disney_ticket_history res where res.ti_status =${STATUS} and... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies

8. Programming

How to pass parameter from file to sqlplus in UNIX?

i have file in which i have employee id are there and every time number of employee id are different in file means number of count of employee id in file are every time different. 343535435 365765767 343534543 343543543 i want to pass this file to sqlplus and sql command is ... (7 Replies)
Discussion started by: pallvi_mahajan
7 Replies

9. Shell Programming and Scripting

Unable to pass value from .Shell script to .SQL file

Hi All, I am new to shell script. I am trying to pass value from .sh file to .sql file . But I am able to run the .sql file from .sh file with values in sql file. But I am unable to pass the values from .sh file. can some one please help to resolve this. here is my .sh file s1.sh ... (4 Replies)
Discussion started by: reddy298599
4 Replies

10. UNIX for Beginners Questions & Answers

Pass value from sqlplus to shell on AIX

hello friend good morning I have a problem, how can I take the value that the PROCEDURE returns to me in the variable "CodError", when the connection to the bbdd is closed I lose the value and I need it in the shell #AIX cat <<EOF | sqlplus -s ${ORA_LOGIN}/${ORA_PASSWORD} > $logftmp set... (6 Replies)
Discussion started by: tricampeon81
6 Replies
RoPkg::DB(3pm)						User Contributed Perl Documentation					    RoPkg::DB(3pm)

NAME
RoPkg::DB - A Singleton database pool class VERSION
0.1.12 DESCRIPTION
RoPkg::DB is a database pool class. Using this class you can have access to multiple databases (no matter what kind of database), from a single object. RoPkg::DB is ideal in persistent environments because at base, is a singleton class. This class is intensively used by Simba but it can be used in any other project. SYNOPSIS
use RoPkg::DB; sub main { my $dbp = new RoPkg::DB(); eval { $dbp->Add('dbi:mysql:database=mysql;host=localhost', 'root', '', 'local'); $dbp->Add('dbi:mysql:database=somedb;host=somehost', 'username', 'mypass', 'somedb'); }; die($@->package . ' said: ' . $@->message) if ref($@); print 'Conn to localhost is:',$dbp->db_local,$/, 'Conn to remote is:',$dbp->db_somedb,$/; $dbp->Del('somedb'); } SUBROUTINES
/METHODS All methods (besides new), raise OutsideClass exception when are not called within a class instance. Also, each method may raise diferent exceptions from one case to another. Please read the documentation for each method to find out what are the exceptions raised by each method. new() new is the contructor of the class. It does not do anything. Add($dsn, $dbuser, $dbpass, $conn_name) add and initialize a new connection to the pool. $dsn must be in the DBI format. $dsn and $dbpass are the username and password used to connect to the database. $conn_name is the method who will be used to access the database handle. Please note that the method that will be created will be prefixed with "db_" . Example: $dbp->Add('dbi:mysql:database=mysql;host=localhost','root',q{},'local'); The method that will be used to get the database handle for this connection is db_local . Add() may raise the following exceptions: *) Param::Missing *) DB::ConnExists *) DB::Connect Param::Missing is raised when $dsn, $dbuser or $conn_name are not defined. DB::ConnExists is raised when a connection with the name $conn_name already exists. DB::Connect is raised when the connection with the database could not be established. Besides this exceptions, each database handler has RaiseError set to 1 and PrintError set to 0. Also, when errors occurs, DBI will raise a DB exception. The method always returns 1. Del($name) removes the connection named $name from the pool. The connection is closed first in a civilised manner. If the connection $name is not found, DB::ConnNotFound is raised. Has($name) Returns 0 if the connection named $name does not exists, 1 otherwise. Param::Missing exception is raised if $name is not defined. Reconnect($name) Force a reconnect of the connection named $name. If $name is not defined, Param::Missing is raised. If a connection named $name does not exists, DB::ConnNotFound is raised. This method always returns 1. TableExists($name, $table_name) Returns 1 if the table $table_name exists in the database specified by the connection named $name, 0 otherwise. If $name or $table_name parameters are not defined, a Param::Missing exception is raised. If the connection $name does not exists, DB::ConnNotFound is raised. DEPENDENCIES
RoPkg::DB requires perl 5.008 or later and the following modules: RoPkg >= 0.4.4 DBI Class::Singleton English DIAGNOSTICS
This module comes with tests. To run the tests, unpack the source and run 'make test' PERL CRITIC
This module is perl critic level 2 compliant (with 1 exception) CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files or environment variables. The used modules however may use such things. Please refer to each module man page for more information. INCOMPATIBILITIES
None known to the author BUGS AND LIMITATIONS
None known to the author SEE ALSO
RoPkg::DBObject RoPkg::Exceptions RoPkg::Utils AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE AND COPYRIGHT
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.8.8 2006-06-09 RoPkg::DB(3pm)
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy