Sponsored Content
Top Forums Shell Programming and Scripting Passing a parameter from a shell script to sqlplus Post 302844048 by Mahomed on Friday 16th of August 2013 08:18:00 AM
Old 08-16-2013
Hi Durden_Tyler,

Thank you very much for your help.

You are correct, the PER12.sql script does have the ACCEPT statement, I will now modify and try...

before:
ACCEPT v_personId PROMPT 'Enter a valid PERSON_ID for the employee: '
PROMPT
ACCEPT v_payElements PROMPT 'Display Payroll Element Entries (Y|N): '

After:
ACCEPT v_personId = &1
REM PROMPT 'Enter a valid PERSON_ID for the employee: '
REM PROMPT
ACCEPT v_payElements = &2
REM PROMPT 'Display Payroll Element Entries (Y|N): '


Let me give this a bash.

Cheers!!!
Mahomed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing parameters from a shell script to sqlplus

Hi , I want to pass parameters from a shell script to a sql script and use the parameter in the sql query ..and then I want to spool a particular select query on to my unix box... for 4 different locations by writing only one sql script Right now no file is generated on the unix box...it is a... (2 Replies)
Discussion started by: phani
2 Replies

2. Shell Programming and Scripting

error in passing a variable to sqlplus from a shell script

hi, I am using a shell script from where i will be conecting to sqlplus.. i am having a problem in passing a variable to sqlplus query.. i will be assigning the variable in the unix environment..whenever i am trying to pass a variable having the contents greater than 2500 characters, i am... (3 Replies)
Discussion started by: kripssmart
3 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

Passing parameter from one file to shell script

Hi All, I have a 2 files. File1 i am generating using an ETL tool, which is a comman seperated delimited file which contains country code & load date. everytime, this country code will be updated from a table. It might be AB or BA & ld_date will be for which date we need to load the file. ... (7 Replies)
Discussion started by: Amit.Sagpariya
7 Replies

5. AIX

Passing a parameter to a shell script?

I would like to run a compress script on files in certain directories. My compress_script.sh is just basically compress file* In order for me to use this I have to copy it into each directory and run it. How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies

6. SCO

Parameter passing to dot shell script

OS SCO Open Server 6.0 MP4 I am trying to change the value of a enviornment variable thru a script and want to pass a parameter on the commande line, If I hard code the value inside the script the script changes the enviornment variable . mytest where my test is MYVAR=$1 export MYVAR... (6 Replies)
Discussion started by: atish0
6 Replies

7. Shell Programming and Scripting

Passing Parameter containing space in between to Shell Script

Hi, I have one shell script which use two parameter however one of its parameter have space in between. eg. a.sh 20110114 b c d here b c d is one parameter I used 'b c d' but its not giving correct result. Also i tried b\c\d but this one also didnt work. Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies

8. UNIX for Dummies Questions & Answers

Passing a Unix parameter to SQLPlus login command

hi All, i m trying to pass a user choice paramter from unix to sqlplus connect command here i want the user to enter the username and password he wants to connect in sql plus through read in unix and then automatically connect to that instance. sqlplus -s $1/$2 where $ 1 and $2 will b... (2 Replies)
Discussion started by: Jcpratap
2 Replies

9. Shell Programming and Scripting

Shell Script passing parameters to sqlplus code

Hello All, I am interested in finding out a way to pass parameters that are entered at the prompt from HP unix and passed to SQLPlus code with a Shell Script. Is this possible? Thanks (4 Replies)
Discussion started by: compprog11
4 Replies

10. Shell Programming and Scripting

Passing parameter with single quote to shell script

Hello All, I am trying below +++++++++ #/bin/bash set -x Host=$1 Port=$2 User=$3 Pass=$4 Warning=$5 Critical=$6 SCRIPT_LOC=/opt/agent/ Parameters="'""hostname=$Host&""port=$Port&""username=$User&""password=$Pass&""jvm=UsedMemory,$Warning,$Critical""'" echo $Parameters... (10 Replies)
Discussion started by: sundari127
10 Replies
LOCKOUT(1)							      lockout								LOCKOUT(1)

NAME
lockout - avoid slacking and impose productivity and discipline on yourself WARNING
This program is VERY DANGEROUS. If it fails, you may end up not knowing the root password to your own computer (in which case you need to boot into single-user mode). There are no known reports of this actually happening, but we don't know how stupid you are. Also, you should probably not run this on a multi-user system. SYNOPSIS
lockout lock HhMm | Hh | Mm lockout lock HH:MM lockout lock HH:MMam | HH:MMpm lockout lock HHam | HHpm lockout lock lockout unlock [force] lockout status DESCRIPTION
Lockout is a tool that imposes discipline on you so that you get some work done. For example, lockout can be used to install a firewall that does not let you browse the Web. Lockout changes the root password for a specified duration; this prevents you from secretly ripping down the firewall and then browsing the Web anyway. In case of an emergency, you can reboot your computer to undo the effects of lockout and to restore the original root password. Obviously, lockout lock and lockout unlock can only be run by root. lockout status can be run by any user. lockout without any parameters shows a brief help message. lockout lock takes one optional parameter. If no parameter is given, you are dropped in interactive mode and asked for the duration of the lock or the time at which the lock should be lifted. You can also supply this as a parameter on the command line. Lockout understands various time formats. You can specify a delay, e.g., 3h (3 hours), 1h30m (1 hour and 30 minutes), or 90m (1 hour and 30 minutes), or you can specify absolute time, e.g., 2pm, 2:30am, 15:30, etc. You will be asked to confirm the time at which lockout will unlock your system. If you type "yes", lockout executes /etc/lockout/lock.sh and changes the root password to something completely random. /etc/lock- out/lock.sh is a shell script that you write. It takes measures to make sure you stop slacking. For example, it could install a firewall that prevents outgoing connections to port 80. See the "EXAMPLES" section below. lockout unlock takes an optional force parameter. Without any parameters, lockout lock will check whether it is time to unlock the system and, if so, executes /etc/lockout/unlock.sh, which is a shell script that you write. It should undo the effects of /etc/lockout/lock.sh, executed when the system was locked. If you pass the force parameter to lockout unlock, lockout will forcibly unlock your system, whether it was really time for that or not. lockout unlock should be called every minute by cron. See "CONFIGURATION". lockout status will print out the time at which the system is going to be unlocked. CONFIGURATION
/etc/cron.d/lockout must contain the following two entries: */1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1 @reboot root /usr/bin/lockout unlock force >/dev/null 2>&1 The examples that follow assume you are using sudo(8) and you have a file, /etc/lockout/sudoers.normal which is the normal /etc/sudoers file, and /etc/lockout/sudoers.lock, which is the /etc/sudoers file when lockout locks your computer. This example also assumes you are using iptables(8). /var/lib/iptables/active should contain your default firewall rules, and /var/lib/iptables/work should contain the firewall rules that enforce discipline. See below for an example. /etc/lock/lock.sh imposes discipline. For example: #!/bin/sh /etc/init.d/iptables load work cp /etc/lockout/sudoers.lock /etc/sudoers /etc/init.d/sudo stop /etc/init.d/sudo start /etc/lock/unlock.sh undoes these effects. For example: #!/bin/sh /etc/init.d/iptables restart cp /etc/lockout/sudoers.normal /etc/sudoers /etc/init.d/sudo stop /etc/init.d/sudo start Your /var/lib/iptables/work may look something like this: *filter :INPUT ACCEPT [1047:99548] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [1104:120792] # allow incoming packets from localhost, ntp, # and existing connections -A INPUT -i lo -j ACCEPT -A INPUT -p udp -m udp --source-port ntp -m state --state ESTABLISHED -j ACCEPT -A INPUT -m state --state ESTABLISHED -j ACCEPT -A INPUT -p tcp -j DROP -A INPUT -p udp -j DROP # allow outgoing connections for email and DNS -A OUTPUT -d 127.0.0.1/8 -j ACCEPT -A OUTPUT -p tcp -m tcp --dport smtp -j ACCEPT -A OUTPUT -p tcp -m tcp --dport domain -j ACCEPT -A OUTPUT -p udp -m udp --dport domain -j ACCEPT -A OUTPUT -j DROP COMMIT EXAMPLES
lockout lock 2h30m [locks out for 2h and 30m] lockout lock 90m [locks out for 1h and 30m] lockout lock 3pm [locks out until 3pm] lockout lock 3:20am [locks out until 3:20am] lockout lock 15:20 [locks out until 3:20pm] lockout status [shows when the system is going to be unlocked] FILES
/etc/lockout/lock.sh: executed when running lockout lock /etc/lockout/unlock.sh: executed when running lockout unlock SEE ALSO
usermod(8), iptables(8), passwd(1), cron(8), crontab(1) BUGS
Arguably, a program that changes the root password to something random with the possibility of never recovering the original password might be considered a bug by itself. Other than that, no known bugs. AUTHOR
Thomer M. Gil, http://thomer.com/lockout/ lockout 2004-09-08 LOCKOUT(1)
All times are GMT -4. The time now is 06:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy