Sponsored Content
Full Discussion: SQLplus in Shell scripts
Top Forums Shell Programming and Scripting SQLplus in Shell scripts Post 302110889 by anbu23 on Friday 16th of March 2007 06:21:56 AM
Old 03-16-2007
try this
Code:
v_source_query="select source_query from source where source_id = $1;"

echo $v_source_query

v_source_value=`sqlplus -S "$DATABASE_LOGIN" << EOF

set feed off
set pagesize 0
set head off
set linesize 2000

$v_source_query;

EOF
`
echo $v_source_value

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sqlplus and shell scripting

i would like to learn how to integrate my little knowledge in shell scripting with sqlplus. well... i know how to make basic query in sqlplus but i dont know how i can integrate it with shell script. can someone :) please help me on this? can you give me some basic example on how to do this kind of... (10 Replies)
Discussion started by: inquirer
10 Replies

2. UNIX for Advanced & Expert Users

sqlplus and sh scripts (to_char command))

Hi evrybody!!!! I have a problem with this shell script INICIO=$(sqlplus -s user/user@db1 << END | awk '{printf $1}' set head off set feed off select to_char(min(create_dt) , 'HH24') from table_name where trunc(create_dt)=trunc(sysdate-2); END) I want to recover, in INICIO, the min... (4 Replies)
Discussion started by: josecollantes
4 Replies

3. Shell Programming and Scripting

calling sqlplus from shell

Hi All, I am executing the following code :- sqlplus -s ${DATABASE_USER} |& print -p -- 'set feed off pause off pages 0 head off veri off line 500' print -p -- 'set term off time off serveroutput on size 1000000' print -p -- "set sqlprompt ''" print -p -- "SELECT run_command from... (2 Replies)
Discussion started by: suds19
2 Replies

4. Shell Programming and Scripting

connect to sqlplus from shell

I'm writting a shell script and at the begining I login to sqlplus by sqlplus -l user_name/password@instance what I would like is to check if the database is down or not , and if the database has started moved to the next step else sleep for a certain time and then check again . I know how to... (4 Replies)
Discussion started by: aya_r
4 Replies

5. UNIX for Dummies Questions & Answers

editing sqlplus id@passwd in multiple scripts, users and directories

hi all, i was given by my supervisor a task to search for scripts which contain oracle sqlplus i.e "myusername/mypasswd @myDB" in every /home/userfolder, which are, all the scripts made by different user. I've done some find command to search string for sqlplus, but it may up too long to respond.... (8 Replies)
Discussion started by: Helmi
8 Replies

6. Programming

Shell SQLPlus

Hi, I am trying to execute the update statment in shell sqlplus.But nothing prompts.if i do ctrl+c i got the below error. SQL> update table set enabled='N' where type_code='xx'; ^C update table set enabled='N' where type_code='xx' * ERROR at line 1: ORA-01013: user requested... (2 Replies)
Discussion started by: nmahendran
2 Replies

7. Shell Programming and Scripting

list all scripts in crontab which contains the string "sqlplus"

Hi folks I use a Solaris 10 box with Bash shell. I have here a script (it works!) to list all scripts in crontab which contains the string "sqlplus": for i in $(ls `crontab -l | grep -v '#' | awk '{ print $6 }' | grep -v '^$'`); do grep -l 'sqlplus' "$i"; done Is there a more elegant... (1 Reply)
Discussion started by: slashdotweenie
1 Replies

8. 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

9. Red Hat

TNS Timeout Error when connecting to SQLPLUS through scripts only

Hi, I am facing a strange issue when connecting to SQLPLUS via a shell scripts. I am using Linux 2.6.18-274.18.1 and gbash shell. When I connect to SQLPLUS through scripts then it throws TNS Time Out error ""sometimes"" and connects successfully other times.This is only happening when... (9 Replies)
Discussion started by: aashish.sharma8
9 Replies

10. Shell Programming and Scripting

Sqlplus shell

friends because when calling a sqlplus from a shell it brings me the following message sqlplus -s $BDDUSER/$BDDPASS@$BDDHOST @$DIR_SQL/prueba.sql echo "bandera 3 " $? STATUS=$? if ;then echo "bandera 4 " $? #log_info "La ejecucion de... (1 Reply)
Discussion started by: tricampeon81
1 Replies
CPANPLUS::Shell::Default::Plugins::Source(3)		User Contributed Perl Documentation	      CPANPLUS::Shell::Default::Plugins::Source(3)

NAME
CPANPLUS::Shell::Default::Plugins::Source - read in CPANPLUS commands SYNOPSIS
CPAN Terminal> /source /tmp/list_of_commands /tmp/more_commands DESCRIPTION
This is a "CPANPLUS::Shell::Default" plugin that works just like your unix shells source(1) command; it reads in a file that has commands in it to execute, and then executes them. A sample file might look like this: # first, update all the source files x --update_source # find all of my modules that are on the CPAN # test them, and store the error log a ^KANE$' t * p /home/kane/cpan-autotest/log # and inform us we're good to go ! print "Autotest complete, log stored; please enter your commands!" Note how empty lines, and lines starting with a '#' are being skipped in the execution. BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>. AUTHOR
This module by Jos Boumans <kane@cpan.org>. COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved. This library is free software; you may redistribute and/or modify it under the same terms as Perl itself. SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell, cpanp perl v5.16.3 2013-05-20 CPANPLUS::Shell::Default::Plugins::Source(3)
All times are GMT -4. The time now is 10:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy