Sponsored Content
Top Forums Shell Programming and Scripting How to pass Variable from shell script to select query for SqlPlus? Post 302857209 by Scott on Wednesday 25th of September 2013 04:02:15 PM
Old 09-25-2013
A 'here-document' is a construct you can find information about from the man-page for your shell.

Taking what you posted, something like:
Code:
sqlplus -S /nolog << EOF
connect tipls/tipls@plsdev
set echo off feedback off linesize 4000 pagesize 0 sqlprompt '' trimspool on

select res.ti_book_no
  from disney_ticket_history res
 where res.ti_status = '$STATUS' and res.request_file_id
    in (select req.request_file_id
          from disney_ticket_request_file req
         where transaction_date='$TRANSACTION_DATE');
EOF

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass variable to SQLPLUS in a ksh script?

Hi, I am writing a ksh script which will use sqlplus to run a sql and pass 2 variables as the SQL request. In the ksh script, I have 2 variables which are $min_snap and $max_snap holding 2 different numbers. Inside the same script, I am using SQLPLUS to run an Oracle SQL script,... (6 Replies)
Discussion started by: rwunwla
6 Replies

2. UNIX for Dummies Questions & Answers

select count(*) in sqlplus into variable unix shell

Need to select count(*) from table to check for zero result in unix script (2 Replies)
Discussion started by: struggle
2 Replies

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

4. Shell Programming and Scripting

In a csh script, can I set a variable to the result of an SQLPLUS select query?

Can someone tell me why I'm getting error when I try to run this? #!/bin/csh -f source ~/.cshrc # set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus # set count=`$SQLPLUS -s ${DB_LOGIN} << END select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
Discussion started by: gregrobinsonhd
7 Replies

5. Shell Programming and Scripting

redirecting oracle sqlplus select query into file

So, I would like to run differen select queries on multiple databases.. I made a script wich I thought to be called something like.. ./script.sh sql_file_name out.log or to enter select statement in a command line.. (aix) and I did created some shell script wich is not working.. it... (6 Replies)
Discussion started by: bongo
6 Replies

6. Shell Programming and Scripting

Problems with storing oracle sqlplus query output shell script

Hello everyone, I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected. I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
Discussion started by: rockf1bull
3 Replies

7. Shell Programming and Scripting

How to run a SQL select query in Oracle database through shell script?

I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this? Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies

8. Shell Programming and Scripting

How to print the output of a select query using shell script?

HI, I want to connect to database and fetch the count from a table. The sql query is as below : select count(*) from table_test where test_column='read'; How can I print the output of this statement using shell script. Thanks in advance. (4 Replies)
Discussion started by: confused_info
4 Replies

9. Shell Programming and Scripting

Shell Script (ksh) - SQLPlus query filter using a string variable

Using ksh, I am using SQLPlus to execute a query with a filter using a string variable. REPO_DB=DEV1 FOLDER_NM='U_nmalencia' FOLDER_CHECK=$(sqlplus -s /nolog <<EOF CONNECT user/pswd_select@${REPO_DB} set echo off heading off feedback off select subj_name from subject where... (5 Replies)
Discussion started by: nkm0brm
5 Replies

10. Shell Programming and Scripting

Pass a VARIABLE to sqlplus script

Hi Team, I am trying to run a sqlplus script against several databases via a FOR/LOOP and also passing the loop variable to a sqlplus script I am calling, as follows: #!/bin/bash export ORACLE_SID=plgc1 export ORACLE_HOME=/opt/oracle/product/11.2.0.2/db_1 export... (1 Reply)
Discussion started by: jonnyd
1 Replies
QDomText(3qt)															     QDomText(3qt)

NAME
QDomText - Represents text data in the parsed XML document SYNOPSIS
All the functions in this class are reentrant when Qt is built with thread support.</p> #include <qdom.h> Inherits QDomCharacterData. Inherited by QDomCDATASection. Public Members QDomText () QDomText ( const QDomText & x ) QDomText & operator= ( const QDomText & x ) ~QDomText () QDomText splitText ( int offset ) virtual QDomNode::NodeType nodeType () const virtual bool isText () const DESCRIPTION
The QDomText class represents text data in the parsed XML document. You can split the text in a QDomText object over two QDomText objecs with splitText(). For further information about the Document Object Model see http://www.w3.org/TR/REC-DOM-Level-1/ and http://www.w3.org/TR/DOM- Level-2-Core/. For a more general introduction of the DOM implementation see the QDomDocument documentation. See also XML. MEMBER FUNCTION DOCUMENTATION
QDomText::QDomText () Constructs an empty QDomText object. To construct a QDomText with content, use QDomDocument::createTextNode(). QDomText::QDomText ( const QDomText & x ) Constructs a copy of x. The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode(). QDomText::~QDomText () Destroys the object and frees its resources. bool QDomText::isText () const [virtual] Returns TRUE. Reimplemented from QDomNode. QDomNode::NodeType QDomText::nodeType () const [virtual] Returns TextNode. Reimplemented from QDomCharacterData. Reimplemented in QDomCDATASection. QDomText &; QDomText::operator= ( const QDomText & x ) Assigns x to this DOM text. The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode(). QDomText QDomText::splitText ( int offset ) Splits this DOM text object into two QDomText objects. This object keeps its first offset characters and the second (newly created) object is inserted into the document tree after this object with the remaining characters. The function returns the newly created object. See also QDomNode::normalize(). SEE ALSO
http://doc.trolltech.com/qdomtext.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdomtext.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QDomText(3qt)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy