Sponsored Content
Top Forums Shell Programming and Scripting SQLPLUS command with more than 1 select statement Post 302901289 by Makarand Dodmis on Tuesday 13th of May 2014 06:43:24 AM
Old 05-13-2014
one way is
Code:
processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS
                whenever sqlerror exit sql.sqlcode;
       set head off feedback off echo off pages 0
       SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE  DOMAIN_NAME =  '${tabname}'
             AND STUDY_NAME = '${studyName}' AND UPPER(STATUS) = 'RUNNING';
       EXIT;
       CHK_PROCESS`
struc_change=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS
                whenever sqlerror exit sql.sqlcode;
       set head off feedback off echo off pages 0
       SELECT STRUCTURE_CHANGE FROM LSHADMIN.DATA_DOMAIN WHERE  DOMAIN_NAME =  '${tabname}'
             AND STUDY_NAME = '${studyName}';
       EXIT;
       CHK_PROCESS`

 

10 More Discussions You Might Find Interesting

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

2. UNIX and Linux Applications

Oracle Select IN statement

If I recall, when I used informix I could do a sql statement like: SELECT Value from Table WHERE ID in (100,200,300); How do I do this in Oracle? I believe I am using Oracle 10 if that matters. Thanks. (1 Reply)
Discussion started by: benefactr
1 Replies

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

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

5. UNIX for Advanced & Expert Users

SQLPlus Select with Grep

I m trying to grep 'select * from' from a script, but the problem is with the * ... I think its taking * as some special character ... when I try to do grep '*' test (test is my test file) its displaying * But when I am trying to do grep 'select * from' test its not showing anything... (2 Replies)
Discussion started by: RDR
2 Replies

6. UNIX and Linux Applications

linux sqlplus select results writes into file twice

Hello, This is my first post and its because I could not find solution for myself I decided to ask help here. What I want to do; I want to get some data from a table 1 on server 1 and insert those datas into a table 2 on server 2. ( lets say schema names are server1 and server 2 also ).... (10 Replies)
Discussion started by: azuahaha
10 Replies

7. Programming

SQLPlus Case statement on a substring

Hi, I have an SQL query that returns a substring of a field and I want to work a case statement on it, but either I get a syntax error or in it's current manifestation the case is ignored all together. select distinct dbms_lob.substr(msg_body,1,4) as networkId, A_STATUS, count(*) from... (1 Reply)
Discussion started by: chris01010
1 Replies

8. Shell Programming and Scripting

Connecting sqlplus from UNIX with multiple select statement

hi, i have a requirement where i need to connect sqlplus from unix and i am able to do so by following command: cust_count=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF set pagesize 0 set feedback off set verify off ... (1 Reply)
Discussion started by: lovelysethii
1 Replies

9. Shell Programming and Scripting

Use sqlplus statement inside case sentence

Hello, I have a problem. I want to launch a different sql queries for different shell parameter values, something like this. #/bin/bash case $1 in "A") sqlplus -s user/pass << SQL query A; SQL "B") sqlplus -s user/pass << SQL2 ... (3 Replies)
Discussion started by: Vares
3 Replies

10. 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
asadmin-create-instance(1AS)											      asadmin-create-instance(1AS)

y"; "User Commands"

NAME
asadmin-create-instance, create-instance - creates an application server instance with the specified instance name SYNOPSIS
create-instance [--user admin_user] [-password admin_password] [--host localhost] [--port 4848] [--sysuser sys_user] [--domain domain_name] [--local=false] [--passwordfile filename] [--secure|-s]--instanceport instanceportinstance_name You can create a new instance on a local or remote machine. If on the remote machine an administration server is already running for the specified hostname, then the system defaults to the local hostname. To create the instance locally, not requiring the administration server to be up and running, specify the --local option. The named instance must not exist within that domain. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --sysuser owner of the domain directory. --domain name of the domain. --local determines if the command should delegate the request to administrative instance or run locally. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. --instanceport port where the instance listens for requests. OPERANDS
instance_name name of the instance to be created. Example 1: Using create-instance in local mode asadmin> create-instance --domain domain1 --instanceport 8967 --sysuser adminuser server4 Created Instance server4 successfully Where: the server4 instance is created under the domain1 domain. Example 2: Using create-instance in remote mode asadmin> create-instance --sysuser adminuser --user admin --password adminadmin --host localhost --port 4848 --instanceport 8967 server4 Created Instance server4 successfully Where: the server4 instance is created on the remote server for the associated user, password, host, and port. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Application Server instances page asadmin-delete-instance(1AS), asadmin-start-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS) J2EE 1.4 SDK/refmiscinfo> March 2004 asadmin-create-instance(1AS)
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy