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)																 cancel(1)

NAME
cancel - cancel print request SYNOPSIS
cancel [ request-ID...] [destination...] cancel -u user... [destination...] The cancel utility cancels print requests. There are two forms of the cancel command. The first form of cancel has two optional arguments: print requests (request-ID) and destinations (destination). Specifying request-ID with destination cancels request-ID on destination. Specifying only the destination cancels the current print request on destination. If desti- nation is not specified, cancel cancels the requested print request on all destinations. The second form of cancel cancels a user's print requests on specific destinations. Users can only cancel print requests associated with their username. By default, users can only cancel print requests on the host from which the print request was submitted. If a super-user has set user-equivalence=true in /etc/printers.conf on the print server, users can cancel print requests associated with their username on any host. Super-users can cancel print requests on the host from which the print request was submitted. Superusers can also cancel print requests from the print server. The print client commands locate destination information using the printers database in the name service switch. See nsswitch.conf(4), printers(4), and printers.conf(4) for details. The following options are supported: -u user The name of the user for which print requests are to be cancelled. Specify user as a username. The following operands are supported: destination The destination on which the print requests are to be canceled. destination is the name of a printer or class of printers (see lpadmin(1M)). If destination is not specified, cancel cancels the requested print request on all destinations. Specify destination using atomic or POSIX-style (server:destination), names. See for information regarding using POSIX-style des- tination names with cancel. See standards(5) for information regarding POSIX. request-ID The print request to be canceled. Specify request-ID using LP-style request IDs (destination-number). user The name of the user for which the print requests are to be cancelled. Specify user as a username. The following exit values are returned: 0 Successful completion. non-zero An error occurred. /var/spool/print/* LP print queue. $HOME/.printers User-configurable printer database. /etc/printers.conf System printer configuration database. printers.conf.byname NIS version of /etc/printers.conf. printers.org_dir NIS+ version of /etc/printers.conf. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpcu | +-----------------------------+-----------------------------+ lp(1), lpq(1B), lpr(1B), lprm(1B), lpstat(1), lpadmin( 1M), nsswitch.conf(4), printers(4), printers.conf(4), attributes(5), standards(5) POSIX-style destination names (server:destination) are treated as print requests if destination has the same format as an LP-style request- ID. See standards(5). Some print servers send cancelation notification to job owners when their print jobs have been cancelled. This notification usually comes in the form of an email message. Cancelation notices cannot be disabled on a Solaris server. 23 Feb 2005 cancel(1)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy