Sponsored Content
Top Forums Shell Programming and Scripting Need Help: Shell script to call sql session with variables stored in .txt file Post 302922903 by RavinderSingh13 on Wednesday 29th of October 2014 03:29:46 AM
Old 10-29-2014
Hello Khan28,

You can try with following as a startup. Let's say we have cancel.txt as follows.
Code:
cat cancel.txt
USER_NAME= Singh
Password= xyz
universe= abscedd

Then script can be as follows.
Code:
cat test_script.ksh
user=`awk -F"=" '/USER_NAME/ {print $2}' cancel.txt`
password=`awk -F"=" '/Password/ {print $2}' cancel.txt`
universe=`awk -F"=" '/universe/ {print $2}' cancel.txt`
sqlplus "$user"/"$password"@"$universe" < QUERIES.sql > Output_file
 
you can do testings here with Output file as per your reqiurements.

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how can a call shell script from pl/sql

I like to call a shell script from pl/sql proceduere and i have to use the shell script return value in that procedure. i am using oracle 9i and cygwin. can any one suggest me how can i do this (0 Replies)
Discussion started by: rajesh.P
0 Replies

2. Shell Programming and Scripting

how can i call a shell script from pl/sql

I would like to call the shell script from pl/sql and i need to uses the value returned by the shell script in pl/sql procedure. can any one suggest me how can i do that? (3 Replies)
Discussion started by: rajesh.P
3 Replies

3. Shell Programming and Scripting

how to call shell script from pl/sql loop

Hello, I am doing a shell script which contain a pl/sql loop to search for 3 values, i would like to call another shell script inside this sql loop each time it find the values. so how can i call shell script from pl/sql using its variables, any idea? Here is idea about the code: my... (1 Reply)
Discussion started by: rosalinda
1 Replies

4. Shell Programming and Scripting

call shell script from pl/sql block

Hi Experts, I want to call script_name.ksh as many time as id in customer table and also pass it as a parameter to script. someting Like below. for i in select id from customer do ./script_name.ksh $i & done I have figured out how to have ID from customer but now how to call... (3 Replies)
Discussion started by: Opamps123
3 Replies

5. Shell Programming and Scripting

How to call stored procedure with CLOB out parameter from shell script?

I have written a stored procedure in oracle database, which is having a CLOB OUT parameter. How can i call this stored procedure from shell script and get the CLOB object in shell script variable? (0 Replies)
Discussion started by: vel4ever
0 Replies

6. UNIX for Advanced & Expert Users

call sql through shell script

Hi i am not able to connect sqlplus my script is as follows $ORACLE_HOME/bin/sqlplus << ! > /tmp/extract/DM.txt and output is SQL*Plus: Release 11.1.0.7.0 - Production on Wed Jan 18 02:53:54 2012 Copyright (c) 1982, 2008, Oracle. All rights reserved. Enter user-name: t175481... (1 Reply)
Discussion started by: tushar_spatil
1 Replies

7. Shell Programming and Scripting

Need to write shell script for my .sql file call

Hi Guys, I need to write a simple shell script which will generate a .csv file/report by calling .sql file inside a shell script. Can somebody help me on this. Thanks in advance! Regards, LK (7 Replies)
Discussion started by: lakshmanraok117
7 Replies

8. Shell Programming and Scripting

How to call SQL Loader in shell script?

HI Experts, I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into the table. Also i... (1 Reply)
Discussion started by: sam1234
1 Replies

9. Programming

Writing a UNIX shell script to call a C function and redirecting data to a .txt file

Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far: #include<stdio.h> #include<string.h>... (2 Replies)
Discussion started by: bjhjh
2 Replies

10. Shell Programming and Scripting

Shell script to call sql file

hi , the below script contains sql query and after executed it sends the output of the query (output.txt) to an email body with conditional subject line based on the output of all_counts_match.txt. i want to make this script generic so that it can accept the sql file as parameter and can... (5 Replies)
Discussion started by: itzkashi
5 Replies
cancel(1)							    Apple Inc.								 cancel(1)

NAME
cancel - cancel jobs SYNOPSIS
cancel [ -E ] [ -U username ] [ -a ] [ -h hostname[:port] ] [ -u username ] [ -x ] [ id ] [ destination ] [ destination-id ] DESCRIPTION
The cancel command cancels print jobs. If no destination or id is specified, the currently printing job on the default destination is can- celed. OPTIONS
The following options are recognized by cancel: -a Cancel all jobs on the named destination, or all jobs on all destinations if none is provided. -E Forces encryption when connecting to the server. -h hostname[:port] Specifies an alternate server. -U username Specifies the username to use when connecting to the server. -u username Cancels jobs owned by username. -x Deletes job data files in addition to canceling. CONFORMING TO
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#". Also, printer and class names are not case-sensitive. EXAMPLES
Cancel the current print job: cancel Cancel job "myprinter-42": cancel myprinter-42 Cancel all jobs: cancel -a NOTES
Administrators wishing to prevent unauthorized cancellation of jobs via the -u option should require authentication for Cancel-Jobs opera- tions in cupsd.conf(5). SEE ALSO
cupsd.conf(5), lp(1), lpmove(8), lpstat(1), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc. 15 April 2014 CUPS cancel(1)
All times are GMT -4. The time now is 03:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy